You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// eslint-disable-next-line jest/no-if -- jest doesn't support conditional tests
111
+
if(isConcurrentReact){
112
+
// eslint-disable-next-line jest/no-conditional-expect -- yes, jest still doesn't support conditional tests
113
+
expect(performConcurrentRender).not.toThrow()
114
+
}else{
115
+
// eslint-disable-next-line jest/no-conditional-expect -- yes, jest still doesn't support conditional tests
116
+
expect(performConcurrentRender).toThrowError(
117
+
`"Attempted to use concurrent React with \`react-dom@${ReactDOM.version}\`. Be sure to use the \`next\` or \`experimental\` release channel (https://reactjs.org/docs/release-channels.html)."`,
118
+
)
119
+
}
120
+
})
121
+
122
+
test('can be called multiple times on the same container',()=>{
// default to document.body instead of documentElement to avoid output of potentially-large
42
-
// head elements (such as JSS style blocks) in debug output
43
-
baseElement=document.body
41
+
functioncreateConcurrentRoot(container,options){
42
+
if(typeofReactDOM.createRoot!=='function'){
43
+
thrownewTypeError(
44
+
`Attempted to use concurrent React with \`react-dom@${ReactDOM.version}\`. Be sure to use the \`next\` or \`experimental\` release channel (https://reactjs.org/docs/release-channels.html).'`,
// eslint-disable-next-line no-negated-condition -- we want to map the evolution of this over time. The root is created first. Only later is it re-used so we don't want to read the case that happens later first.
0 commit comments