react
react copied to clipboard
Fix flow suppressions in DOMProperty
Replaces the function constructor call with a factory method. This makes this covered by Flow.
I think if an object is created from a literal in one place it should always have the same hidden class, but I'm curious if I'm missing something here why this should be a new call.
I think if an object is created from a literal in one place it should always have the same hidden class, but I'm curious if I'm missing something here why this should be a new call.
Same question will come up with FiberNode (and possibly more locations). There's a bit more context in https://github.com/facebook/react/blob/2cf4352e1c81a5b8c3528519a128c20e8e65531d/packages/react-reconciler/src/ReactFiber.new.js#L210-L231 but notably it also mentions we can convert this to a literal if that's faster.
The property records are only created once though so it may not matter at all what we do there?