Skip to content

Commit d43b53d

Browse files
committed
fix(dev): wrap AutoRender in forwardRef
1 parent 0f79186 commit d43b53d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: src/ui/withAuto.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export function withAuto(render: any) {
9393
if (isDev) {
9494
withAuto.dev = (render: any) => {
9595
const Component = render.length > 1 ? React.forwardRef(render) : render
96-
function AutoRender(props: any) {
96+
const AutoRender = React.forwardRef((props: any, ref: any) => {
9797
const { auto, depth, commit } = useAutoRender(Component)
9898
function useCommit(observer: AutoObserver) {
9999
let nonce = 0
@@ -111,10 +111,10 @@ if (isDev) {
111111
}
112112
return (
113113
<AutoDepth value={depth + 1}>
114-
<Component {...props} $auto={auto} $useCommit={useCommit} />
114+
<Component {...props} ref={ref} $auto={auto} $useCommit={useCommit} />
115115
</AutoDepth>
116116
)
117-
}
117+
})
118118
Object.defineProperty(AutoRender, 'displayName', {
119119
get: () => 'AutoRender',
120120
set(displayName) {

0 commit comments

Comments
 (0)