Skip to content

Commit f1f4940

Browse files
author
Madeline Trotter
committed
Fix concurrent mode ffi, add more warnings about usage
1 parent 95da91c commit f1f4940

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/React/Basic/DOM/Concurrent.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use strict";
22

33
const ReactDOM = require("react-dom");
4+
const createRoot = ReactDOM.createRoot || ReactDOM.unstable_createRoot;
45

56
exports.renderConcurrentMode = (jsx) => (element) => () =>
6-
ReactDOM.createRoot(element).render(jsx);
7+
createRoot(element).render(jsx);
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
-- Warning: The concurrent-mode API is experimental and not yet intended for
2+
-- use in production applications. See the React docs for more info.
13
module React.Basic.DOM.Concurrent where
24

35
import Prelude
@@ -6,5 +8,5 @@ import React.Basic (JSX)
68
import Web.DOM (Element)
79

810
-- Alternative to `render` which enables React's concurrent mode.
9-
-- This is an experimental feature. See the React docs for more info.
11+
-- This is an unstable and experimental feature. See the React docs for more info.
1012
foreign import renderConcurrentMode :: JSX -> Element -> Effect Unit

0 commit comments

Comments
 (0)