Skip to content

Commit 5dc0540

Browse files
committed
fix: with ref example
1 parent 4d9b797 commit 5dc0540

File tree

1 file changed

+8
-2
lines changed
  • example/storybook/stories/components/primitives/Image

1 file changed

+8
-2
lines changed

example/storybook/stories/components/primitives/Image/WithRef.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ export function Example() {
66
const myRef = React.useRef(null);
77

88
React.useEffect(() => {
9-
if (myRef.current && myRef.current.setNativeProps)
10-
myRef.current?.setNativeProps({ borderWidth: 10, opacity: 0.5 });
9+
const styleObj = {
10+
borderWidth: 4,
11+
borderRadius: 4,
12+
borderColor: '#22D3EE',
13+
};
14+
myRef?.current?.setNativeProps({
15+
style: styleObj,
16+
});
1117
}, [myRef]);
1218

1319
return (

0 commit comments

Comments
 (0)