Deprecated
You don't need to install anything.
Use React.ComponentProps<T> defined in @types/react
😉
Infer types of props from React component
Contents
📦 How to get the code?
This is package is one line of code, so you can either install it or copy-paste it 😉
🔌 Installation
yarn add --dev props-of
📃 Source
;
❔ Why
And now we can use it for props of parent component.
; ;
📚 I want to know more
You can learn about infer
and conditional types at
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html