simon360 / react-from-markup

Declare your React components with static HTML
MIT License
18 stars 4 forks source link

Solve potential race condition in render #26

Closed simon360 closed 6 years ago

simon360 commented 6 years ago

If rehydrate is called twice in quick succession, the calls to ReactDOM.render and ReactDOM.unmountComponentAtNode can conflict.

Come up with a solution that ensures render always finishes before unmountComponentAtNode can get called again.

simon360 commented 6 years ago

Looks like this might not be a race condition, but is actually a problem with declaring a data-react-from-markup-container in JSX. It should be declared as innerHTML instead.