React
Code splitting
const Component = React.lazy(() => import('./path/to/component'))Links
Higher order components (HOC)
// App.jsx
const withExtraProps = (component) => {
const Component = component
return function(props) {
return <Component {...props} />
}
}
const App = () => {
return (
<h1>App</h1>
)
}
const AppWithExtra = withExtraProps(App)
export default AppWithExtraLast updated