I have a custom React Fiber Reconciler, which I create using the default export from the react-reconciler
package.
In a ReactDOM Component, I execute
this.mountNode = CustomRenderer.createContainer(this.stage)
CustomRenderer.updateContainer(
<SomeContextProvider>{children}<SomeContextProvider/>,
this.mountNode,
this
)
However, when I open the React devtools, I get
Uncaught TypeError: Cannot read property 'replace' of null in the getDataFiber method here:
case HostComponent:
nodeType = 'Native';
name = fiber.type;
// TODO (bvaughn) we plan to remove this prefix anyway.
// We can cut this special case out when it's gone.
name = name.replace('topsecret-', ''); /////////// Error here on this line
This appears to be because fiber.type
is null.
Searching around, i see people passing a type as the second argument to their renderer's createContainer, but doing so gives me a weird and seemingly unrelated error of
Uncaught TypeError: scheduleDeferredCallback is not a function
Uncaught TypeError: cancelDeferredCallback is not a function
, so this probably isn't the right thing to do.
The Host config is pretty long, so here it is in a gist: https://gist.github.com/arilotter/d34c684da13a4825285ddfe021ec4be3
And here's my package.json
:
https://gist.github.com/arilotter/fd53712900f726a46c1d9a6ceeaf151c
Where can I specify the type
for my container, so the devtools work?
package.json
? – Bonbon