Skip to content

Commit

Permalink
[compat] Add noop React.StrictMode (#2529)
Browse files Browse the repository at this point in the history
  • Loading branch information
developit committed May 11, 2020
1 parent 375db9f commit 2b7397a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions compat/src/index.js
Expand Up @@ -95,6 +95,12 @@ function findDOMNode(component) {
// eslint-disable-next-line camelcase
const unstable_batchedUpdates = (callback, arg) => callback(arg);

/**
* Strict Mode is not implemented in Preact, so we provide a stand-in for it
* that just renders its children without imposing any restrictions.
*/
const StrictMode = Fragment;

export * from 'preact/hooks';
export {
version,
Expand All @@ -117,6 +123,7 @@ export {
forwardRef,
// eslint-disable-next-line camelcase
unstable_batchedUpdates,
StrictMode,
Suspense,
SuspenseList,
lazy
Expand Down Expand Up @@ -153,6 +160,7 @@ export default {
memo,
forwardRef,
unstable_batchedUpdates,
StrictMode,
Suspense,
SuspenseList,
lazy
Expand Down

0 comments on commit 2b7397a

Please sign in to comment.