Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions templates/react-with-storybook/example/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'react-app-polyfill/ie11';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { createRoot } from 'react-dom/client';
import { Thing } from '../.';

const App = () => {
Expand All @@ -11,4 +11,6 @@ const App = () => {
);
};

ReactDOM.render(<App />, document.getElementById('root'));
const container = document.getElementById('root');
const root = createRoot(container!);
root.render(<App />);
7 changes: 4 additions & 3 deletions templates/react-with-storybook/test/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react';
import * as ReactDOM from 'react-dom';
import { createRoot, unmountComponentAtNode } from 'react-dom/client';
import { Default as Thing } from '../stories/Thing.stories';

describe('Thing', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<Thing />, div);
ReactDOM.unmountComponentAtNode(div);
const root = createRoot(div!);
root.render(<Thing />);
root.unmount(div);
});
});
6 changes: 4 additions & 2 deletions templates/react/example/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'react-app-polyfill/ie11';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { createRoot } from 'react-dom/client';
import { Thing } from '../.';

const App = () => {
Expand All @@ -11,4 +11,6 @@ const App = () => {
);
};

ReactDOM.render(<App />, document.getElementById('root'));
const container = document.getElementById('root');
const root = createRoot(container!);
root.render(<App />);
7 changes: 4 additions & 3 deletions templates/react/test/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { createRoot } from 'react-dom/client';
import { Thing } from '../src';

describe('Thing', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<Thing />, div);
ReactDOM.unmountComponentAtNode(div);
const root = createRoot(div!);
root.render(<Thing />);
root.unmount(div);
});
});
Loading