Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/content/reference/react/useLayoutEffect.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export default function ButtonWithTooltip({ tooltipContent, ...rest }) {
}
```

```js
```js src/Tooltip.js
import { useRef, useLayoutEffect, useState } from 'react';
import { createPortal } from 'react-dom';
import TooltipContainer from './TooltipContainer.js';
Expand Down Expand Up @@ -263,7 +263,7 @@ React guarantees that the code inside `useLayoutEffect` and any state updates sc

<Sandpack>

```js
```js src/App.js
import ButtonWithTooltip from './ButtonWithTooltip.js';

export default function App() {
Expand Down Expand Up @@ -337,7 +337,7 @@ export default function ButtonWithTooltip({ tooltipContent, ...rest }) {
}
```

```js
```js src/Tooltip.js
import { useRef, useLayoutEffect, useState } from 'react';
import { createPortal } from 'react-dom';
import TooltipContainer from './TooltipContainer.js';
Expand Down
2 changes: 1 addition & 1 deletion src/content/reference/react/useMemo.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export default function App() {

```

```js
```js src/TodoList.js
import { useMemo } from 'react';
import { filterTodos } from './utils.js'

Expand Down