Skip to content

Commit 5ad38ef

Browse files
Add pinned react and react-dom versions to fix codebox examples (#13827)
1 parent a6b2cb5 commit 5ad38ef

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

website/modules/components/Example.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import SandboxExample from "./SandboxExample.js";
66

77
export default function Example({ data, match }) {
88
const { example: exampleParam, environment } = match.params;
9-
const example = data.examples.find((e) => e.slug === exampleParam);
9+
const example = data.examples.find(e => e.slug === exampleParam);
1010
const isNative = environment === "native";
1111

1212
return example ? (
@@ -15,11 +15,13 @@ export default function Example({ data, match }) {
1515
label={example.label}
1616
path={example.path}
1717
dependencies={{
18-
"react-router-native": "latest",
18+
"react-router-native": "^5.3.0",
1919
"react-native-web": "latest",
2020
"react-art": "latest",
2121
"react-scripts": "latest",
22-
...(example.extraDependencies || {}),
22+
react: "^18",
23+
"react-dom": "^18",
24+
...(example.extraDependencies || {})
2325
}}
2426
code={example.code}
2527
extraEmbedOptions={{ editorsize: 66, hidenavigation: true }}
@@ -31,7 +33,9 @@ export default function Example({ data, match }) {
3133
dependencies={{
3234
"react-router-dom": "^5.3.0",
3335
"react-scripts": "latest",
34-
...(example.extraDependencies || {}),
36+
react: "^18",
37+
"react-dom": "^18",
38+
...(example.extraDependencies || {})
3539
}}
3640
code={example.code}
3741
/>
@@ -46,7 +50,7 @@ Example.propTypes = {
4650
match: PropTypes.shape({
4751
params: PropTypes.shape({
4852
example: PropTypes.string,
49-
environment: PropTypes.string,
50-
}),
51-
}),
53+
environment: PropTypes.string
54+
})
55+
})
5256
};

0 commit comments

Comments
 (0)