Skip to content

Commit d05b45b

Browse files
committed
Update code examples in useLayoutEffect and useMemo documentation to specify source files
1 parent 8d73630 commit d05b45b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/content/reference/react/useLayoutEffect.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export default function ButtonWithTooltip({ tooltipContent, ...rest }) {
187187
}
188188
```
189189
190-
```js
190+
```js src/Tooltip.js
191191
import { useRef, useLayoutEffect, useState } from 'react';
192192
import { createPortal } from 'react-dom';
193193
import TooltipContainer from './TooltipContainer.js';
@@ -263,7 +263,7 @@ React guarantees that the code inside `useLayoutEffect` and any state updates sc
263263
264264
<Sandpack>
265265
266-
```js
266+
```js src/App.js
267267
import ButtonWithTooltip from './ButtonWithTooltip.js';
268268

269269
export default function App() {
@@ -337,7 +337,7 @@ export default function ButtonWithTooltip({ tooltipContent, ...rest }) {
337337
}
338338
```
339339
340-
```js
340+
```js src/Tooltip.js
341341
import { useRef, useLayoutEffect, useState } from 'react';
342342
import { createPortal } from 'react-dom';
343343
import TooltipContainer from './TooltipContainer.js';

src/content/reference/react/useMemo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export default function App() {
225225

226226
```
227227

228-
```js
228+
```js src/TodoList.js
229229
import { useMemo } from 'react';
230230
import { filterTodos } from './utils.js'
231231

0 commit comments

Comments
 (0)