Skip to content

Commit 3a3374d

Browse files
author
sunilsonumonu12
committed
fix: correct smart quotes rendering for 'mirroring' text
- Replace straight quotes with HTML entities (“ ”) around 'mirroring' and 'Mirroring' - Fixes typography issue where smart quotes plugin rendered double opening quotes - Ensures consistent curly quote rendering in both instances (lines 358, 367) Resolves mismatched quote rendering in choosing-the-state-structure.md
1 parent da58344 commit 3a3374d

File tree

4 files changed

+3688
-3027
lines changed

4 files changed

+3688
-3027
lines changed

package.json

Lines changed: 1 addition & 1 deletion
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",
1111
"lint:fix": "next lint --fix",

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

Lines changed: 3 additions & 3 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 }) {
@@ -2826,4 +2826,4 @@ Keep in mind that you [should not mutate objects in state](/learn/updating-objec
28262826
28272827
</Solution>
28282828
2829-
</Challenges>
2829+
</Challenges>

src/utils/compileMDX.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {MDXComponents} from 'components/MDX/MDXComponents';
33

44
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55
// ~~~~ IMPORTANT: BUMP THIS IF YOU CHANGE ANY CODE BELOW ~~~
6-
const DISK_CACHE_BREAKER = 10;
6+
const DISK_CACHE_BREAKER = 11;
77
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
88

99
export default async function compileMDX(
@@ -99,6 +99,10 @@ export default async function compileMDX(
9999
const fakeRequire = (name: string) => {
100100
if (name === 'react/jsx-runtime') {
101101
return require('react/jsx-runtime');
102+
} else if (name === 'react/jsx-dev-runtime') {
103+
// In development builds Babel may compile to jsxDEV from 'react/jsx-dev-runtime'
104+
// Ensure we return the correct dev runtime to avoid jsxDEV being undefined
105+
return require('react/jsx-dev-runtime');
102106
} else {
103107
// For each fake MDX import, give back the string component name.
104108
// It will get serialized later.

0 commit comments

Comments
 (0)