Set React to Strict Mode

Set React to Strict Mode.

See: https://reactjs.org/docs/strict-mode.html
This commit is contained in:
nixocio 2020-07-09 15:37:19 -04:00
parent d0ac028265
commit 01f210e392
2 changed files with 9 additions and 2 deletions

View File

@ -7,6 +7,8 @@ import { BrandName } from './variables';
document.title = `Ansible ${BrandName}`;
ReactDOM.render(
<App />,
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('app') || document.createElement('div')
);

View File

@ -12,6 +12,11 @@ require('./index.jsx');
describe('index.jsx', () => {
it('renders ok', () => {
expect(ReactDOM.render).toHaveBeenCalledWith(<App />, div);
expect(ReactDOM.render).toHaveBeenCalledWith(
<React.StrictMode>
<App />
</React.StrictMode>,
div
);
});
});