Skip to content

Commit dbca499

Browse files
committed
Fix broken tabs
Was too overzealous deleting stuff in #8058
1 parent 8d73630 commit dbca499

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/content/reference/react-dom/createPortal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ Here is a complete example you can play with:
398398
}
399399
```
400400

401-
```js
401+
```js src/App.js
402402
import { useRef, useEffect, useState } from 'react';
403403
import { createPortal } from 'react-dom';
404404
import { createMapWidget, addPopupToMapWidget } from './map-widget.js';

src/content/reference/react/useLayoutEffect.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ To do this, you need to render in two passes:
8787
8888
**All of this needs to happen before the browser repaints the screen.** You don't want the user to see the tooltip moving. Call `useLayoutEffect` to perform the layout measurements before the browser repaints the screen:
8989
90-
```js
90+
```js {5-8}
9191
function Tooltip() {
9292
const ref = useRef(null);
9393
const [tooltipHeight, setTooltipHeight] = useState(0); // You don't know real height yet
@@ -187,7 +187,7 @@ export default function ButtonWithTooltip({ tooltipContent, ...rest }) {
187187
}
188188
```
189189
190-
```js
190+
```js src/Tooltip.js active
191191
import { useRef, useLayoutEffect, useState } from 'react';
192192
import { createPortal } from 'react-dom';
193193
import TooltipContainer from './TooltipContainer.js';
@@ -337,7 +337,7 @@ export default function ButtonWithTooltip({ tooltipContent, ...rest }) {
337337
}
338338
```
339339
340-
```js
340+
```js src/Tooltip.js active
341341
import { useRef, useLayoutEffect, useState } from 'react';
342342
import { createPortal } from 'react-dom';
343343
import TooltipContainer from './TooltipContainer.js';
@@ -484,7 +484,7 @@ export default function ButtonWithTooltip({ tooltipContent, ...rest }) {
484484
}
485485
```
486486
487-
```js
487+
```js src/Tooltip.js active
488488
import { useRef, useEffect, useState } from 'react';
489489
import { createPortal } from 'react-dom';
490490
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 active
229229
import { useMemo } from 'react';
230230
import { filterTodos } from './utils.js'
231231

0 commit comments

Comments
 (0)