File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 22
33const ReactDOM = require ( "react-dom" ) ;
44const createRoot = ReactDOM . createRoot || ReactDOM . unstable_createRoot ;
5+ const createBlockingRoot =
6+ ReactDOM . createBlockingRoot || ReactDOM . unstable_createBlockingRoot ;
57
6- exports . renderConcurrentMode = ( jsx ) => ( element ) => ( ) =>
7- createRoot ( element ) . render ( jsx ) ;
8+ exports . createRoot = ( element ) => ( ) => createRoot ( element ) ;
9+
10+ exports . createBlockingRoot = ( element ) => ( ) => createBlockingRoot ( element ) ;
11+
12+ exports . renderRoot = ( root ) => ( jsx ) => ( ) => root . render ( jsx ) ;
Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ import Effect (Effect)
77import React.Basic (JSX )
88import Web.DOM (Element )
99
10- -- Alternative to `render` which enables React's concurrent mode.
11- -- This is an unstable and experimental feature. See the React docs for more info.
12- foreign import renderConcurrentMode :: JSX -> Element -> Effect Unit
10+ foreign import data ReactRoot :: Type
11+
12+ foreign import createRoot :: Element -> Effect ReactRoot
13+
14+ foreign import createBlockingRoot :: Element -> Effect ReactRoot
15+
16+ foreign import renderRoot :: ReactRoot -> JSX -> Effect Unit
You can’t perform that action at this time.
0 commit comments