Comment

Comment by liamdanielduffy

Regarding 3, you actually can use PropTypes to define the shape of an object passed as a prop using PropTypes.shape({...})! You can also specify the types of all of the keys of the object.

I find this super useful in many of my projects, I hope it helps with some of yours!

https://reactjs.org/docs/typechecking-with-proptypes.html

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton