News for hackers. Stuff that matters.
Re:Beyond React 16 by Dan Ambramov – Async Rendering and Rea... by wereHamster on Thursday March 01, 2018 @02:10PM (#16495111)
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.
Re:Beyond React 16 by Dan Ambramov – Async Rendering and Rea... by acemarke on Thursday March 01, 2018 @02:17PM (#16495182)
It'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()`.
Re:Beyond React 16 by Dan Ambramov – Async Rendering and Rea... by wereHamster on Thursday March 01, 2018 @02:39PM (#16495415)
Wait, can render functions now throw, legally?
Re:Beyond React 16 by Dan Ambramov – Async Rendering and Rea... by timdorr on Thursday March 01, 2018 @02:48PM (#16495490)
Yup. This builds on error boundaries and componentDidCatch: https://reactjs.org/blog/2017/07/26/error-handling-in-react-...
Re:Beyond React 16 by Dan Ambramov – Async Rendering and Rea... by danabramov on Thursday March 01, 2018 @02:49PM (#16495507)
Yes. (For this use case.)