Skip to content

Commit edb403a

Browse files
author
sunilsonumonu12
committed
do
1 parent 366b5fb commit edb403a

File tree

4 files changed

+3108
-4021
lines changed

4 files changed

+3108
-4021
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "CC",
66
"scripts": {
77
"analyze": "ANALYZE=true next build",
8-
"dev": "next-remote-watch ./src/content",
8+
"dev": "next-remote-watch ./src/content -p 5173",
99
"build": "next build && node --experimental-modules ./scripts/downloadFonts.mjs",
1010
"lint": "next lint && eslint \"src/content/**/*.md\"",
1111
"lint:fix": "next lint --fix && eslint \"src/content/**/*.md\" --fix",
@@ -74,7 +74,7 @@
7474
"eslint-plugin-local-rules": "link:eslint-local-rules",
7575
"eslint-plugin-react": "7.x",
7676
"eslint-plugin-react-compiler": "^19.0.0-beta-e552027-20250112",
77-
"eslint-plugin-react-hooks": "^0.0.0-experimental-fabef7a6b-20221215",
77+
"eslint-plugin-react-hooks": "^4.6.0",
7878
"fs-extra": "^9.0.1",
7979
"globby": "^11.0.1",
8080
"gray-matter": "^4.0.2",

src/content/learn/choosing-the-state-structure.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ function Message({ messageColor }) {
355355
356356
Here, a `color` state variable is initialized to the `messageColor` prop. The problem is that **if the parent component passes a different value of `messageColor` later (for example, `'red'` instead of `'blue'`), the `color` *state variable* would not be updated!** The state is only initialized during the first render.
357357
358-
This is why "mirroring" some prop in a state variable can lead to confusion. Instead, use the `messageColor` prop directly in your code. If you want to give it a shorter name, use a constant:
358+
This is why “mirroring” some prop in a state variable can lead to confusion. Instead, use the `messageColor` prop directly in your code. If you want to give it a shorter name, use a constant:
359359
360360
```js
361361
function Message({ messageColor }) {
@@ -364,7 +364,7 @@ function Message({ messageColor }) {
364364
365365
This way it won't get out of sync with the prop passed from the parent component.
366366
367-
"Mirroring" props into state only makes sense when you *want* to ignore all updates for a specific prop. By convention, start the prop name with `initial` or `default` to clarify that its new values are ignored:
367+
“Mirroring” props into state only makes sense when you *want* to ignore all updates for a specific prop. By convention, start the prop name with `initial` or `default` to clarify that its new values are ignored:
368368
369369
```js
370370
function Message({ initialColor }) {

src/utils/compileMDX.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,13 @@ export default async function compileMDX(
103103

104104
// Prepare environment for MDX.
105105
let fakeExports = {};
106+
const jsxRuntime = require('react/jsx-runtime');
107+
const jsxDevRuntime = require('react/jsx-dev-runtime');
106108
const fakeRequire = (name: string) => {
107109
if (name === 'react/jsx-runtime') {
108-
return require('react/jsx-runtime');
110+
return jsxRuntime;
111+
} else if (name === 'react/jsx-dev-runtime') {
112+
return jsxDevRuntime;
109113
} else {
110114
// For each fake MDX import, give back the string component name.
111115
// It will get serialized later.

0 commit comments

Comments
 (0)