Skip to content

Commit

Permalink
[examples] Update create-react-app examples with styled-components to…
Browse files Browse the repository at this point in the history
… use package aliases (#27591)
  • Loading branch information
mnajdova authored Aug 4, 2021
1 parent 4fb6b01 commit 873e79c
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ npm start

<!-- #default-branch-switch -->

Note that CodeSandbox is not supporting react-app-rewired, yet you can [still see the code](https://codesandbox.io/s/github/mui-org/material-ui/tree/next/examples/create-react-app-with-styled-components-typescript).

The following link leverages this demo: https://next.material-ui.com/guides/interoperability/#change-the-default-styled-engine with Parcel's alias feature within the `package.json`

[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/styled-components-interoperability-w9z9d)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"@material-ui/core": "next",
"@material-ui/lab": "next",
"@material-ui/styled-engine-sc": "next",
"@material-ui/styled-engine": "npm:@material-ui/styled-engine-sc@next",
"@testing-library/jest-dom": "latest",
"@testing-library/react": "latest",
"@testing-library/user-event": "latest",
Expand All @@ -14,12 +14,15 @@
"react-scripts": "latest",
"styled-components": "latest"
},
"resolutions": {
"@material-ui/styled-engine": "npm:@material-ui/styled-engine-sc@next"
},
"scripts": {
"tsc": "./node_modules/.bin/tsc",
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-app-rewired eject"
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"browserslist": {
"production": [
Expand All @@ -38,8 +41,6 @@
"@types/react": "latest",
"@types/react-dom": "latest",
"@types/styled-components": "latest",
"customize-cra": "latest",
"react-app-rewired": "latest",
"typescript": "latest"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"paths": {
"@material-ui/styled-engine": ["./node_modules/@material-ui/styled-engine-sc"]
}
"skipLibCheck": true
},
"include": ["src/**/*"]
}
2 changes: 0 additions & 2 deletions examples/create-react-app-with-styled-components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ npm start

<!-- #default-branch-switch -->

Note that CodeSandbox is not supporting react-app-rewired, yet you can [still see the code](https://codesandbox.io/s/github/mui-org/material-ui/tree/next/examples/create-react-app-with-styled-components).

The following link leverages this demo: https://next.material-ui.com/guides/interoperability/#change-the-default-styled-engine with Parcel's alias feature within the `package.json`

[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/styled-components-interoperability-w9z9d)
Expand Down

This file was deleted.

17 changes: 8 additions & 9 deletions examples/create-react-app-with-styled-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"@material-ui/core": "next",
"@material-ui/lab": "next",
"@material-ui/styled-engine-sc": "next",
"@material-ui/styled-engine": "npm:@material-ui/styled-engine-sc@next",
"@testing-library/jest-dom": "latest",
"@testing-library/react": "latest",
"@testing-library/user-event": "latest",
Expand All @@ -14,11 +14,14 @@
"react-scripts": "latest",
"styled-components": "latest"
},
"resolutions": {
"@material-ui/styled-engine": "npm:@material-ui/styled-engine-sc@next"
},
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-app-rewired eject"
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"browserslist": {
"production": [
Expand All @@ -31,9 +34,5 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"customize-cra": "latest",
"react-app-rewired": "latest"
}
}

0 comments on commit 873e79c

Please sign in to comment.