firefox-devtools / devtools-core

:rocket: Packages for Firefox DevTools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace wrapRender with componentDidThrow

nchevobbe opened this issue · comments

wrapRender was introduced to prevent crashing a panel when a component was throwing an exception.
In React 16 there's a new lifecycle function which does exactly this: componentDidThrow.
In order to use it, we have to turn Rep from a function to a React component so it has access to the lifecycle method.

We'll have to check that this does not harm performances in the console.