What is a higher order component? Create One higher order compoent which defines the proper usecase of HOC? code example
Example 1: Higher order components (HOC) react native
const EnhancedComponent = higherOrderComponent(WrappedComponent);
Example 2: high level components react
import React, { useState } from 'react';
class WelcomeName extends React.Component {
render() {
return <h1>Hello, {this.props.name}</h1>
}
}
function HighHookWelcome() {
const [name ,setName] = useState("Default Name Here");
return(
<WelcomeName
name={name}
/>
);
}