In a gutenberg block, I want to use useEntityProp but wait for the results

Question

I’m using useEntityProp to fetch the value of site options

useEntityProp( 'root', 'site', 'something' )

This obviously takes half-a-second or something finite to fetch. But my block depends on this value so I cannot move forward till this value is fetched. How do I “wait” for this and only then proceed with rendering the block, something equivalent to componentDidMount perhaps?

0
Roz 3 weeks 2023-05-08T00:51:52-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse