Skip to content

Commit da05d87

Browse files
philibeagregberge
authored andcommitted
fix: fix ref handler in loadable.lib
1 parent 3ae704a commit da05d87

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/component/src/library.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import createLoadable from './createLoadable'
33

44
export const { loadable, lazy } = createLoadable({
55
onLoad(result, props) {
6-
if (result && props.ref) {
7-
if (typeof props.ref === 'function') {
8-
props.ref(result)
6+
if (result && props.forwardedRef) {
7+
if (typeof props.forwardedRef === 'function') {
8+
props.forwardedRef(result)
99
} else {
10-
props.ref.current = result
10+
props.forwardedRef.current = result
1111
}
1212
}
1313
},

0 commit comments

Comments
 (0)