File tree Expand file tree Collapse file tree 2 files changed +27
-3
lines changed
kitchen-sink/src/examples Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 1+ import { block } from 'million/react' ;
2+
3+ const Svg = block ( ( ) => {
4+ return (
5+ < div >
6+ < svg
7+ xmlns = "http://www.w3.org/2000/svg"
8+ fill = "none"
9+ viewBox = "0 0 24 24"
10+ strokeWidth = { 1.5 }
11+ stroke = "currentColor"
12+ className = "w-6 h-6"
13+ >
14+ < path
15+ strokeLinecap = "round"
16+ strokeLinejoin = "round"
17+ d = "M4.5 12.75l6 6 9-13.5"
18+ />
19+ </ svg >
20+ </ div >
21+ ) ;
22+ } ) ;
23+
24+ export default Svg ;
Original file line number Diff line number Diff line change @@ -37,11 +37,11 @@ export const processProps = (
3737export const renderReactScope = (
3838 vnode : ReactNode ,
3939 unstable : boolean ,
40- portals : MillionPortal [ ] ,
40+ portals : MillionPortal [ ] | undefined ,
4141 currentIndex : number ,
4242 server : boolean ,
4343) => {
44- const el = portals [ currentIndex ] ?. current ;
44+ const el = portals ?. [ currentIndex ] ?. current ;
4545 if ( typeof window === 'undefined' || ( server && ! el ) ) {
4646 return createElement (
4747 RENDER_SCOPE ,
@@ -72,7 +72,7 @@ export const renderReactScope = (
7272 portal : reactPortal ,
7373 unstable,
7474 } ;
75- portals [ currentIndex ] = millionPortal ;
75+ if ( portals ) portals [ currentIndex ] = millionPortal ;
7676
7777 return millionPortal ;
7878} ;
You can’t perform that action at this time.
0 commit comments