Put createRoot export under a feature flag#11426
Conversation
|
This only seems to disable tests, not export itself? |
0fbab4a to
13c67ad
Compare
|
Not sure how I missed that. 😳 |
| return new ReactRoot(container, hydrate); | ||
| }, | ||
|
|
||
| var ReactDOM: Object = { |
There was a problem hiding this comment.
For my own understanding of Flow, does : Object distinguish ReactDOM's type over what Flow can infer?
There was a problem hiding this comment.
I guess this relaxes the type so we can add things to it later. Actually this is probably not a great pattern and we should stop doing this. Since it probably also relaxes which properties it lets us read.
There was a problem hiding this comment.
We should make sure to remove the : Object when removing the enableCreateRoot flag.
| root.render(<div>Hi</div>); | ||
| expect(container.textContent).toEqual('Hi'); | ||
| }); | ||
| if (ReactFeatureFlags.enableCreateRoot) { |
There was a problem hiding this comment.
I'm not sure what you are asking. My understand is that the tests should only run once, or not at all.
|
Oops @acdlite is right. If we disable this in the main feature flags we never run these tests. What we should do instead is to mock the feature flags file in tests. And we need to do the same for fragment tests. Sorry I missed this. |
gaearon
left a comment
There was a problem hiding this comment.
Need to mock feature flags instead to actually run those tests. And do the same for fragments.
|
Please see #11430. |
13c67ad to
b3f6051
Compare
As per the request of @acdlite . This feature is not ready to ship yet.