Skip to content

Commit 64aee8b

Browse files
WesSouzaarturbien
authored andcommitted
chore: restore React 16 support
This restores importing React and the ESLint rule react/react-in-jsx-scope to preserve React 16 compatibility. This also moves some types around so themes can be exported as a standalone with its own TypeScript config.
1 parent 2eac4e8 commit 64aee8b

128 files changed

Lines changed: 240 additions & 174 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codesandbox/ci.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"installCommand": "install:codesandbox",
32
"buildCommand": "build:prod",
4-
"sandboxes": ["react95-template-xkfj0"]
3+
"node": "16",
4+
"sandboxes": [
5+
"react95-template-xkfj0"
6+
]
57
}

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ module.exports = {
4343
'react/jsx-props-no-spreading': 'off',
4444
'react/no-array-index-key': 'off',
4545
'react/prop-types': 'off',
46-
'react/react-in-jsx-scope': 'off',
4746
'react/require-default-props': 'off',
4847
'react/static-property-placement': ['error', 'static public field']
4948
},

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
"lint": "eslint --ext .js,.ts,.tsx src",
4747
"lint:fix": "yarn run lint --fix",
4848
"semantic-release": "semantic-release",
49-
"install:codesandbox": "yarn --ignore-engines",
5049
"cz": "git-cz"
5150
},
5251
"peerDependencies": {

src/Anchor/Anchor.spec.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import React from 'react';
2+
13
import { render } from '@testing-library/react';
24

35
import { Anchor } from './Anchor';

src/Anchor/Anchor.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ComponentMeta } from '@storybook/react';
2+
import React from 'react';
23
import styled from 'styled-components';
34

45
import { Anchor } from './Anchor';

src/AppBar/AppBar.spec.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { render } from '@testing-library/react';
2+
import React from 'react';
23

34
import { AppBar } from './AppBar';
45

src/AppBar/AppBar.stories.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import React from 'react';
2-
import styled from 'styled-components';
1+
import { ComponentMeta } from '@storybook/react';
2+
import React, { useState } from 'react';
33
import {
44
AppBar,
5-
Toolbar,
6-
TextField,
75
Button,
6+
Divider,
87
List,
98
ListItem,
10-
Divider
9+
TextField,
10+
Toolbar
1111
} from 'react95';
12-
import { ComponentMeta } from '@storybook/react';
12+
import styled from 'styled-components';
1313
import logoIMG from '../assets/images/logo.png';
1414

1515
const Wrapper = styled.div`
@@ -24,7 +24,7 @@ export default {
2424
} as ComponentMeta<typeof AppBar>;
2525

2626
export function Default() {
27-
const [open, setOpen] = React.useState(false);
27+
const [open, setOpen] = useState(false);
2828

2929
return (
3030
<AppBar>

src/Avatar/Avatar.spec.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { render } from '@testing-library/react';
2+
import React from 'react';
23

34
import { renderWithTheme, theme } from '../../test/utils';
45

src/Avatar/Avatar.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ComponentMeta } from '@storybook/react';
2+
import React from 'react';
23
import { Avatar } from 'react95';
34
import styled from 'styled-components';
45

src/Bar/Bar.spec.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import React from 'react';
2+
13
import { renderWithTheme } from '../../test/utils';
24

35
import { Bar } from './Bar';

0 commit comments

Comments
 (0)