All questions

How do I get TypeScript types for the content a slot returns in React?

Asked by dan.k on

Ddan.k

I am tired of treating slot content as any in my React components. Right now I destructure useContent('home-hero') and TypeScript has no idea what the fields are, so nothing is checked.

How does the SDK expose the types for what each slot returns, and how do I keep them in sync as the slots change

Was this helpful?

0 answers

Still have questions?