Merge pull request #7596 from nixocio/ui_set_strict_mode

Set React to Strict Mode

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2020-07-27 15:56:57 +00:00 committed by GitHub
commit 6b867e7d97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
);
});
});