Skip to content

Commit a1c3cb9

Browse files
fix: sidenav sibling seperated v3
1 parent 31c15c4 commit a1c3cb9

File tree

2 files changed

+2
-25
lines changed

2 files changed

+2
-25
lines changed
Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,4 @@
11
// eslint-disable-next-line @typescript-eslint/no-explicit-any
22
export const ThemeSwitch = () => {
3-
return (
4-
<>
5-
<button className="fern-search-bar w-full">
6-
<span className="search-placeholder">
7-
<svg
8-
width="15"
9-
height="15"
10-
viewBox="0 0 15 15"
11-
fill="none"
12-
xmlns="http://www.w3.org/2000/svg"
13-
className="size-5">
14-
<path
15-
d="M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z"
16-
fill="currentColor"
17-
fill-rule="evenodd"
18-
clip-rule="evenodd"></path>
19-
</svg>
20-
<span>Search...</span>
21-
</span>
22-
<span className="keyboard-shortcut-hint">/</span>
23-
</button>
24-
hello
25-
</>
26-
)
3+
return <>hello</>
274
}

custom-implementation/src/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const render = async () => {
4141
)
4242

4343
// console.log('sibling', search, search?.parentNode)
44-
ReactDOM.render(React.createElement(ThemeSwitch), sidenav)
44+
ReactDOM.createPortal(React.createElement(ThemeSwitch), sidenav)
4545
}
4646

4747
let observations = 0

0 commit comments

Comments
 (0)