react#StrictMode JavaScript Examples

The following examples show how to use react#StrictMode. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.js    From React-Messenger-App with MIT License 6 votes vote down vote up
Demo = () => (
  <div>
    <h1>react-mentions</h1>
    <p>
      <span role="img" aria-labelledby="yay!">
        ?
      </span>
      &nbsp; brought to you by Signavio, docs and code on Github:{' '}
      <a href="https://github.com/signavio/react-mentions">
        https://github.com/signavio/react-mentions
      </a>{' '}
      (BSD license)
    </p>
    <StrictMode>
      <Examples />
    </StrictMode>
  </div>
)
Example #2
Source File: index.jsx    From ResoBin with MIT License 6 votes vote down vote up
StrictApp = () => {
  useEffect(() => {
    initSentry()
  }, [])

  return (
    <StrictMode>
      <Provider store={store}>
        <PersistGate loading={<LoaderAnimation />} persistor={persistor}>
          <Router>
            <HelmetProvider>
              <App />
            </HelmetProvider>
          </Router>
        </PersistGate>
      </Provider>
    </StrictMode>
  )
}
Example #3
Source File: utils.js    From react-menu with MIT License 6 votes vote down vote up
StrictModeWrapper = ({ children }) => <StrictMode>{children}</StrictMode>
Example #4
Source File: index.jsx    From realtime-chat-supabase-react with Apache License 2.0 6 votes vote down vote up
// import * as serviceWorker from "./serviceWorker";

ReactDOM.render(
  <StrictMode>
    {/* <ColorModeScript /> */}
    <App />
  </StrictMode>,
  document.getElementById("root")
);
Example #5
Source File: index.js    From ReactSourceCodeAnalyze with MIT License 6 votes vote down vote up
export default function ElementTypes() {
  return (
    <Profiler id="test" onRender={() => {}}>
      <Fragment>
        <Context.Provider value={'def'}>
          <Context.Consumer>{value => null}</Context.Consumer>
        </Context.Provider>
        <StrictMode>
          <Suspense fallback={<div>Loading...</div>}>
            <ClassComponent />
            <FunctionComponent />
            <MemoFunctionComponent />
            <ForwardRefComponent />
            <LazyComponent />
          </Suspense>
        </StrictMode>
      </Fragment>
    </Profiler>
  );
}
Example #6
Source File: index.js    From covid19india-react with MIT License 6 votes vote down vote up
main = () =>
  render(
    <Suspense fallback={<div />}>
      <Router>
        <StrictMode>
          <App />
        </StrictMode>
      </Router>
    </Suspense>,
    rootElement
  )
Example #7
Source File: App.js    From citr-v6-project with Apache License 2.0 6 votes vote down vote up
App = () => {
  const theme = useState("darkblue");
  return (
    <StrictMode>
      <ThemeContext.Provider value={theme}>
        <div>
          <header>
            <Link to="/">Adopt Me!</Link>
          </header>
          <Switch>
            <Route path="/details/:id">
              <Details />
            </Route>
            <Route path="/">
              <SearchParams />
            </Route>
          </Switch>
        </div>
      </ThemeContext.Provider>
    </StrictMode>
  );
}
Example #8
Source File: index.js    From karto with MIT License 6 votes vote down vote up
root.render(
    <StrictMode>
        <StyledEngineProvider injectFirst>
            <ThemeProvider theme={theme}>
                <CssBaseline/>
                <App/>
            </ThemeProvider>
        </StyledEngineProvider>
    </StrictMode>
);
Example #9
Source File: App.js    From citr-v6-project with Apache License 2.0 5 votes vote down vote up
render(
  <StrictMode>
    <App />
  </StrictMode>,
  document.getElementById("root")
);
Example #10
Source File: App.js    From citr-v6-project with Apache License 2.0 5 votes vote down vote up
render(
  <StrictMode>
    <App />
  </StrictMode>,
  document.getElementById("root")
);
Example #11
Source File: App.js    From citr-v6-project with Apache License 2.0 5 votes vote down vote up
render(
  <StrictMode>
    <App />
  </StrictMode>,
  document.getElementById("root")
);
Example #12
Source File: App.js    From citr-v6-project with Apache License 2.0 5 votes vote down vote up
render(
  <StrictMode>
    <App />
  </StrictMode>,
  document.getElementById("root")
);
Example #13
Source File: App.js    From citr-v6-project with Apache License 2.0 5 votes vote down vote up
render(
  <StrictMode>
    <App />
  </StrictMode>,
  document.getElementById("root")
);
Example #14
Source File: index.js    From react-sample-projects with MIT License 5 votes vote down vote up
root.render(
  <StrictMode>
    <ColorModeScript />
    <App />
  </StrictMode>
);
Example #15
Source File: index.jsx    From cosmoscan-front with Apache License 2.0 5 votes vote down vote up
ReactDOM.render(
  <StrictMode>
    <App />
  </StrictMode>,
  document.getElementById('root'),
);
Example #16
Source File: index.js    From raster-playground with GNU General Public License v3.0 5 votes vote down vote up
render(
  <StrictMode>
    <Provider store={store}>
      <App />
    </Provider>
  </StrictMode>,
  document.getElementById('root')
);
Example #17
Source File: index.js    From minecraft-react with MIT License 5 votes vote down vote up
ReactDOM.render(
  <StrictMode>
    <App />
  </StrictMode>,
  document.getElementById('root')
);
Example #18
Source File: index.js    From Website with MIT License 5 votes vote down vote up
ReactDOM.render(
	<StrictMode>
		<AppContextProvider>
			<App />
		</AppContextProvider>
	</StrictMode>,
	document.getElementById("root")
);
Example #19
Source File: index.js    From teaful with MIT License 5 votes vote down vote up
ReactDOM.render(
    <StrictMode>
      <App />
    </StrictMode>,
    rootElement,
);
Example #20
Source File: index.js    From tisn.app with GNU Affero General Public License v3.0 5 votes vote down vote up
render(
  <StrictMode>
    <App />
  </StrictMode>,
  document.getElementById('root')
);
Example #21
Source File: Builder.js    From dnd-builder with MIT License 4 votes vote down vote up
Builder = ({
  acceptedItems,
  additionalPageItems,
  disableInteraction,
  itemAccessor,
  lastScrollPosition,
  leftPanelConfig,
  onAnEventTrigger,
  onItemAdd,
  onItemChange,
  onItemMove,
  onItemRemove,
  onItemResize,
  onItemsMove,
  onPageAdd,
  onPageChange,
  onPageDuplicate,
  onPageOrdersChange,
  onPageRemove,
  onRightPanelsToggled,
  onSettingChange,
  pages,
  settings,
  theme,
  useExperimentalFeatures,
  ...otherProps
}) => {
  const hashCode = objectHash(otherProps);

  return (
    <StrictMode>
      <BuilderProvider onRightPanelsToggled={onRightPanelsToggled}>
        <PropProvider
          acceptedItems={acceptedItems}
          disableInteraction={disableInteraction}
          onAnEventTrigger={onAnEventTrigger}
          settings={settings}
          useExperimentalFeatures={useExperimentalFeatures}
        >
          <ReportWrapper
            mode="customize"
            pageCount={pages.length}
            theme={theme}
          >
            <DndWrapper>
              <LeftPanel
                leftPanelConfig={leftPanelConfig}
                onItemAdd={onItemAdd}
              />
              <Scene
                additionalPageItems={additionalPageItems}
                hashCode={hashCode}
                itemAccessor={itemAccessor}
                lastScrollPosition={lastScrollPosition}
                onItemAdd={onItemAdd}
                onItemChange={onItemChange}
                onItemMove={onItemMove}
                onItemRemove={onItemRemove}
                onItemResize={onItemResize}
                onItemsMove={onItemsMove}
                onPageAdd={onPageAdd}
                onPageChange={onPageChange}
                onPageDuplicate={onPageDuplicate}
                onPageOrdersChange={onPageOrdersChange}
                onPageRemove={onPageRemove}
                pages={pages}
              />
            </DndWrapper>
            <RightPanel
              itemAccessor={itemAccessor}
              onItemChange={onItemChange}
              onPageChange={onPageChange}
              onSettingChange={onSettingChange}
              pages={pages}
            />
            <SlidesPanel
              additionalPageItems={additionalPageItems}
              hashCode={hashCode}
              itemAccessor={itemAccessor}
              onPageAdd={onPageAdd}
              onPageDuplicate={onPageDuplicate}
              onPageOrdersChange={onPageOrdersChange}
              onPageRemove={onPageRemove}
              pages={pages}
            />
            {useExperimentalFeatures && (
              <AllSlidesPanel
                additionalPageItems={additionalPageItems}
                hashCode={hashCode}
                itemAccessor={itemAccessor}
                onPageAdd={onPageAdd}
                onPageDuplicate={onPageDuplicate}
                onPageOrdersChange={onPageOrdersChange}
                onPageRemove={onPageRemove}
                pages={pages}
              />
            )}
          </ReportWrapper>
        </PropProvider>
      </BuilderProvider>
    </StrictMode>
  );
}