File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 1- import { createElement } from "preact" ;
1+ import { createElement , options } from "preact" ;
22import { useLayoutEffect , useRef } from "preact/hooks" ;
33import { createAuto } from "./core/create-auto" ;
44import { createWrapper } from "./core/create-wrapper" ;
55
6+ const { vnode } = options ;
7+
8+ options . vnode = ( node ) => {
9+ if ( typeof node . type === "function" ) {
10+ //@ts -ignore
11+ node . props . ref = node . ref ;
12+ node . ref = null ;
13+ }
14+ if ( vnode ) vnode ( node ) ;
15+ } ;
16+
617const forwardRef =
7- ( component : ( props : any , ref : any ) => any ) =>
18+ ( callback : ( ... args : any [ ] ) => any ) =>
819 ( { ref, ...props } : any ) =>
9- component ( props , ref ) ;
20+ callback ( props , ref ) ;
1021
1122export const wrapper = createWrapper ( {
1223 createElement,
You can’t perform that action at this time.
0 commit comments