Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
littlecranky67
· 7y ago · 0 comments
This is no different when using Hooks. You specify the type of props as the type of the first argument in the functional component:
function MyComponent(props: IMyComponentProps) { ... }
Where the type definition of IMyComponentProps resides doesn't matter, you can import it from anywhere.
Comments
[–]
teniutza
7y ago
I was simply pointing out that explicitly defining an interface is not necessarily a downside.