3 ms·
But only when passed to HTML elements I hope. Because say I have my own type of the shape `{ then(): Whatever }` and try to pass that as a prop to one of my com
by wereHamster 9y ago
But only when passed to HTML elements I hope. Because say I have my own type of the shape `{ then(): Whatever }` and try to pass that as a prop to one of my components I don't want React to invoke that function.
- acemarke 9y agoIt's not about passing props - the "thenable" detection comes into play if you throw a promise (or something shaped like a promise) from within `render()`.
- wereHamster 9y agoWait, can render functions now throw, legally?
- timdorr 9y agoYup. This builds on error boundaries and componentDidCatch: https://reactjs.org/blog/2017/07/26/error-handling-in-react-16.html https://reactjs.org/blog/2017/07/26/error-handling-in-react-...
- danabramov 9y agoYes. (For this use case.)