Relative Content

Tag Archive for reactjsreact-hoc

What is the difference between these HOC components

Passing children and returning children with additional logic const WithLoadingState =(props)=> { // Handle display the spinner, error message etc if(!props.error) return props.children } Actual HOC component const withLoadingState =(Component) => (props)=> { // Additional logics here, display spinner, error message etc. if(!props.error) return <Component {…props} /> } For the above 2 components, I think […]