The code is:
const MyComponents = () => {
[photos, setPhotos] = useState([])
return (<div>
<PhotoBrowser
photos={photos}
ref={ref}
/>
<Button onClick={_ => setPhotos([{url: 'xxx.jpg', caption: ''}])}>click</Button>
</div>)
}
update photos
state not works