Closed chengzh2008 closed 5 years ago
Thanks for the question - hope you are enjoying the book!
Yes, there is a problem with the withLoader component. We weren't passing all the props to the inner component. Here's what withLoader should look like:
` const withLoader =
( Component: React.ComponentType
): React.SFC<P & IProps> => (props: P & IProps) => props.loading ? (
) : ( <Component {...props} /> ); `
Commit the fixed withLoader: https://github.com/carlrip/LearnReact17WithTypeScript/blob/master/06-ComponentPatterns/src/withLoader.tsx
Thanks for reply the issue fix. Yes, I really enjoy the book. Thanks producing the book!
You made an amazing book, thank you very much @carlrip. It helps me a lot.
You made an amazing book, thank you very much @carlrip. It helps me a lot.
Thanks HieuDexZ, glad you liked it.
Hi, I am reading this book with Chapter 6. I got type error: (below) Type error: Type '{}' is not assignable to type 'P'. TS2322
No sure what is going on.
Thanks for help!