react icon indicating copy to clipboard operation
react copied to clipboard

Fix flow suppressions in DOMProperty

Open kassens opened this issue 3 years ago • 1 comments

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.

kassens avatar Oct 11 '22 14:10 kassens

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?

eps1lon avatar Oct 11 '22 21:10 eps1lon