Merge pull request #7210 from tchak/fix-strict-mode

fix(react): too soon for strict mode
This commit is contained in:
Paul Chavard 2022-04-28 15:00:19 +02:00 committed by GitHub
commit cb6dd3dce9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
import { Controller } from '@hotwired/stimulus';
import React, { lazy, Suspense, FunctionComponent, StrictMode } from 'react';
import React, { lazy, Suspense, FunctionComponent } from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import invariant from 'tiny-invariant';
@ -44,12 +44,7 @@ export class ReactController extends Controller {
Component,
`Cannot find a React component with class "${componentName}"`
);
render(
<StrictMode>
<Component {...props} />
</StrictMode>,
node
);
render(<Component {...props} />, node);
}
private getComponent(componentName: string): FunctionComponent<Props> | null {