Рет қаралды 5,424
Goodbye, forwardRef - The drama in 5 acts.
(reuploaded, audio sync fixed)
📖 Resources:
Docs:
- react.dev/reference/react/for...
- legacy.reactjs.org/docs/forwa...
RFCs:
- github.com/reactjs/rfcs/blob/...
- github.com/reactjs/rfcs/pull/...
- github.com/facebook/react/iss...
GitHub Discussions:
- github.com/facebook/react/iss...
- github.com/facebook/react/iss...
Other:
- fettblog.eu/typescript-react-...
🐦 Tweets:
- / 1230843448057569285
- / 1683414495291486208
- / 1747760712464613834
- / 1718507694443704803
- / 1672305484718800896
- / 1719496241501847884
- / 1635250148208164864
⏱️Timestamps:
00:00 - Intro
00:31 - Act I - Why do we need forwardRef?
01:35 - Act II - 7 issues with forwardRef
01:54 - Issue #1 - It doesn't support multiple refs
02:36 - Issue #2 - Component can loose it's displayName
03:09 - Issue #3 - It's basically a boilerplate
03:30 - Issue #4 - It can be a naming anti-pattern
04:14 - Issue #5 - Complicated TypeScript Issues
05:23 - Issue #6 - Potential Performance Issues
05:52 - Issue #7 - Not supported below React 16.3
06:16 - Act III - The Alternative
08:19 - Act IV - Remaining 5% of cases
10:17 - Act V - Why forwardRef was added to React?
13:18 - RFC to remove forwardRef
14:24 - Why blocking ref forwarding was a mistake