In React Native Programming, what is HOC?

Moderator: Reach-Native-gp

Post Reply
Anisha Sharma
Posts: 11
Joined: Fri May 08, 2020 12:30 pm

In React Native Programming, what is HOC?

Post by Anisha Sharma »

In React Native, HOC stands for Higher-Order Component. It is one of the most advanced techniques of react-native that can be implemented to reuse any component logic.

HOC is implemented as a function which obtains a component and will return you with a new element.

A simple example to demonstrate the implementation of HOC is given below:

function HOC(Comp) {
return class NewComp extends Component {
render() {
return
}
}
}

Post Reply