How can we use useIsPreviewing inside getStaticProps next js

How can we use useIsPreviewing inside getStaticProps next js?

Hi Olivela!

Can you try to update react version to 2.0.0 and then see if useIsPreviewing works?

getStaticProps in next.js is a function that gets called at build time, while the previewing or editing in builder is a check at run time, and specifically the useIsPreviewing is a react hook that can only be used inside a react component or another react hook.

For a reference implementation on using Builder with next.js, please check this example builder/[[...page]].tsx at main · BuilderIO/builder · GitHub