Last active
October 31, 2019 15:49
-
-
Save IniZio/48cf070f866b7a49807fd1f239fc535f to your computer and use it in GitHub Desktop.
mirco-frontend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default () => { | |
return { | |
mount: async el => { | |
const App = await await import('./App') | |
const Wrapper = C => { | |
let setter | |
return () => { | |
const [state, setState] = useState() | |
setter = setState | |
return <C {...p}/> | |
} | |
} | |
const WrappedApp = Wrapper(App) | |
React.render(<WrappedApp/>, el) | |
return c | |
} | |
update: setter, | |
unmount: ReactDOM.unmountComponentAtNode | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment