You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/advanced/patterns_by_usecase.md
+10-36
Original file line number
Diff line number
Diff line change
@@ -873,47 +873,21 @@ As you can see from the Omit example above, you can write significant logic in y
873
873
874
874
## Props: Extracting Prop Types of a Component
875
875
876
-
There are a lot of places where you want to reuse some slices of props because of prop drilling,
877
-
so you can either export the props type as part of the module or extract them (either way works).
876
+
Sometimes you want the prop types of a component, but it isn't exported.
878
877
879
-
The advantage of extracting the prop types is that you won't need to export everything, and a refactor of the source of truth component will propagate to all consuming components.
There are advanced edge cases if you want to extract the prop types of a component taking into account internal props, `propTypes`, and `defaultProps` - [check our issue here for helper utilities that resolve these](https://github.com/typescript-cheatsheets/react/issues/63).
890
+
917
891
## Props: Render Props
918
892
919
893
> Advice: Where possible, you should try to use Hooks instead of Render Props. We include this merely for completeness.
0 commit comments