Fix broken tabs

Was too overzealous deleting stuff in #8058
This commit is contained in:
Lauren Tan
2025-10-07 21:06:45 -07:00
parent 8d73630aa5
commit dbca499a9c
3 changed files with 6 additions and 6 deletions

View File

@@ -398,7 +398,7 @@ Here is a complete example you can play with:
}
```
```js
```js src/App.js
import { useRef, useEffect, useState } from 'react';
import { createPortal } from 'react-dom';
import { createMapWidget, addPopupToMapWidget } from './map-widget.js';

View File

@@ -87,7 +87,7 @@ To do this, you need to render in two passes:
**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:
```js
```js {5-8}
function Tooltip() {
const ref = useRef(null);
const [tooltipHeight, setTooltipHeight] = useState(0); // You don't know real height yet
@@ -187,7 +187,7 @@ export default function ButtonWithTooltip({ tooltipContent, ...rest }) {
}
```
```js
```js src/Tooltip.js active
import { useRef, useLayoutEffect, useState } from 'react';
import { createPortal } from 'react-dom';
import TooltipContainer from './TooltipContainer.js';
@@ -337,7 +337,7 @@ export default function ButtonWithTooltip({ tooltipContent, ...rest }) {
}
```
```js
```js src/Tooltip.js active
import { useRef, useLayoutEffect, useState } from 'react';
import { createPortal } from 'react-dom';
import TooltipContainer from './TooltipContainer.js';
@@ -484,7 +484,7 @@ export default function ButtonWithTooltip({ tooltipContent, ...rest }) {
}
```
```js
```js src/Tooltip.js active
import { useRef, useEffect, useState } from 'react';
import { createPortal } from 'react-dom';
import TooltipContainer from './TooltipContainer.js';

View File

@@ -225,7 +225,7 @@ export default function App() {
```
```js
```js src/TodoList.js active
import { useMemo } from 'react';
import { filterTodos } from './utils.js'