diff --git a/packages/react-dom-bindings/src/client/ReactDOMComponent.js b/packages/react-dom-bindings/src/client/ReactDOMComponent.js
index 4df6de5385764..673fd47eca464 100644
--- a/packages/react-dom-bindings/src/client/ReactDOMComponent.js
+++ b/packages/react-dom-bindings/src/client/ReactDOMComponent.js
@@ -66,7 +66,6 @@ import {validateProperties as validateUnknownProperties} from '../shared/ReactDO
import sanitizeURL from '../shared/sanitizeURL';
import {
- enableBigIntSupport,
disableIEWorkarounds,
enableTrustedTypesIntegration,
enableFilterEmptyStringAttributesDOM,
@@ -370,10 +369,7 @@ function setProp(
if (canSetTextContent) {
setTextContent(domElement, value);
}
- } else if (
- typeof value === 'number' ||
- (enableBigIntSupport && typeof value === 'bigint')
- ) {
+ } else if (typeof value === 'number' || typeof value === 'bigint') {
if (__DEV__) {
// $FlowFixMe[unsafe-addition] Flow doesn't want us to use `+` operator with string and bigint
validateTextNesting('' + value, tag);
@@ -929,10 +925,7 @@ function setPropOnCustomElement(
case 'children': {
if (typeof value === 'string') {
setTextContent(domElement, value);
- } else if (
- typeof value === 'number' ||
- (enableBigIntSupport && typeof value === 'bigint')
- ) {
+ } else if (typeof value === 'number' || typeof value === 'bigint') {
// $FlowFixMe[unsafe-addition] Flow doesn't want us to use `+` operator with string and bigint
setTextContent(domElement, '' + value);
}
@@ -2948,7 +2941,7 @@ export function hydrateProperties(
if (
typeof children === 'string' ||
typeof children === 'number' ||
- (enableBigIntSupport && typeof children === 'bigint')
+ typeof children === 'bigint'
) {
if (
// $FlowFixMe[unsafe-addition] Flow doesn't want us to use `+` operator with string and bigint
diff --git a/packages/react-dom-bindings/src/client/ReactDOMOption.js b/packages/react-dom-bindings/src/client/ReactDOMOption.js
index 10d04bd6f7eb2..ae7a7ba999c06 100644
--- a/packages/react-dom-bindings/src/client/ReactDOMOption.js
+++ b/packages/react-dom-bindings/src/client/ReactDOMOption.js
@@ -8,7 +8,6 @@
*/
import {Children} from 'react';
-import {enableBigIntSupport} from 'shared/ReactFeatureFlags';
let didWarnSelectedSetOnOption = false;
let didWarnInvalidChild = false;
@@ -30,7 +29,7 @@ export function validateOptionProps(element: Element, props: Object) {
if (
typeof child === 'string' ||
typeof child === 'number' ||
- (enableBigIntSupport && typeof child === 'bigint')
+ typeof child === 'bigint'
) {
return;
}
diff --git a/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js b/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js
index d67571fc41e1d..9b9f41a92d374 100644
--- a/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js
+++ b/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js
@@ -84,7 +84,6 @@ import {
import {retryIfBlockedOn} from '../events/ReactDOMEventReplaying';
import {
- enableBigIntSupport,
enableCreateEventHandleAPI,
enableScopeAPI,
enableTrustedTypesIntegration,
@@ -546,7 +545,7 @@ export function shouldSetTextContent(type: string, props: Props): boolean {
type === 'noscript' ||
typeof props.children === 'string' ||
typeof props.children === 'number' ||
- (enableBigIntSupport && typeof props.children === 'bigint') ||
+ typeof props.children === 'bigint' ||
(typeof props.dangerouslySetInnerHTML === 'object' &&
props.dangerouslySetInnerHTML !== null &&
props.dangerouslySetInnerHTML.__html != null)
diff --git a/packages/react-dom-bindings/src/client/ToStringValue.js b/packages/react-dom-bindings/src/client/ToStringValue.js
index e1fc51b775dd4..46708f2f76953 100644
--- a/packages/react-dom-bindings/src/client/ToStringValue.js
+++ b/packages/react-dom-bindings/src/client/ToStringValue.js
@@ -8,7 +8,6 @@
*/
import {checkFormFieldValueStringCoercion} from 'shared/CheckStringCoercion';
-import {enableBigIntSupport} from 'shared/ReactFeatureFlags';
export opaque type ToStringValue =
| boolean
@@ -31,11 +30,6 @@ export function toString(value: ToStringValue): string {
export function getToStringValue(value: mixed): ToStringValue {
switch (typeof value) {
case 'bigint':
- if (!enableBigIntSupport) {
- // bigint is assigned as empty string
- return '';
- }
- // fallthrough for BigInt support
case 'boolean':
case 'number':
case 'string':
diff --git a/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js b/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js
index 623bedd92e6e0..475e934a60491 100644
--- a/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js
+++ b/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js
@@ -28,7 +28,6 @@ import {
import {Children} from 'react';
import {
- enableBigIntSupport,
enableFilterEmptyStringAttributesDOM,
enableFizzExternalRuntime,
} from 'shared/ReactFeatureFlags';
@@ -1664,8 +1663,7 @@ function flattenOptionChildren(children: mixed): string {
!didWarnInvalidOptionChildren &&
typeof child !== 'string' &&
typeof child !== 'number' &&
- ((enableBigIntSupport && typeof child !== 'bigint') ||
- !enableBigIntSupport)
+ typeof child !== 'bigint'
) {
didWarnInvalidOptionChildren = true;
console.error(
@@ -2983,40 +2981,36 @@ function pushTitle(
if (Array.isArray(children) && children.length > 1) {
console.error(
- 'React expects the `children` prop of
tags to be a string, number%s, or object with a novel `toString` method but found an Array with length %s instead.' +
+ 'React expects the `children` prop of tags to be a string, number, bigint, or object with a novel `toString` method but found an Array with length %s instead.' +
' Browsers treat all child Nodes of tags as Text content and React expects to be able to convert `children` of tags to a single string value' +
' which is why Arrays of length greater than 1 are not supported. When using JSX it can be commong to combine text nodes and value nodes.' +
' For example: hello {nameOfUser}. While not immediately apparent, `children` in this case is an Array with length 2. If your `children` prop' +
' is using this form try rewriting it using a template string: {`hello ${nameOfUser}`}.',
- enableBigIntSupport ? ', bigint' : '',
children.length,
);
} else if (typeof child === 'function' || typeof child === 'symbol') {
const childType =
typeof child === 'function' ? 'a Function' : 'a Sybmol';
console.error(
- 'React expect children of tags to be a string, number%s, or object with a novel `toString` method but found %s instead.' +
+ 'React expect children of tags to be a string, number, bigint, or object with a novel `toString` method but found %s instead.' +
' Browsers treat all child Nodes of tags as Text content and React expects to be able to convert children of ' +
' tags to a single string value.',
- enableBigIntSupport ? ', bigint' : '',
childType,
);
} else if (child && child.toString === {}.toString) {
if (child.$$typeof != null) {
console.error(
- 'React expects the `children` prop of tags to be a string, number%s, or object with a novel `toString` method but found an object that appears to be' +
+ 'React expects the `children` prop of tags to be a string, number, bigint, or object with a novel `toString` method but found an object that appears to be' +
' a React element which never implements a suitable `toString` method. Browsers treat all child Nodes of tags as Text content and React expects to' +
' be able to convert children of tags to a single string value which is why rendering React elements is not supported. If the `children` of is' +
' a React Component try moving the tag into that component. If the `children` of is some HTML markup change it to be Text only to be valid HTML.',
- enableBigIntSupport ? ', bigint' : '',
);
} else {
console.error(
- 'React expects the `children` prop of tags to be a string, number%s, or object with a novel `toString` method but found an object that does not implement' +
+ 'React expects the `children` prop of tags to be a string, number, bigint, or object with a novel `toString` method but found an object that does not implement' +
' a suitable `toString` method. Browsers treat all child Nodes of tags as Text content and React expects to be able to convert children of tags' +
' to a single string value. Using the default `toString` method available on every object is almost certainly an error. Consider whether the `children` of this ' +
' is an object in error and change it to a string or number value if so. Otherwise implement a `toString` method that React can use to produce a valid .',
- enableBigIntSupport ? ', bigint' : '',
);
}
}
diff --git a/packages/react-dom-bindings/src/server/escapeTextForBrowser.js b/packages/react-dom-bindings/src/server/escapeTextForBrowser.js
index 6fd43c01c5f69..4514bf66831d7 100644
--- a/packages/react-dom-bindings/src/server/escapeTextForBrowser.js
+++ b/packages/react-dom-bindings/src/server/escapeTextForBrowser.js
@@ -39,7 +39,6 @@
*/
import {checkHtmlStringCoercion} from 'shared/CheckStringCoercion';
-import {enableBigIntSupport} from 'shared/ReactFeatureFlags';
const matchHtmlRegExp = /["'&<>]/;
@@ -110,7 +109,7 @@ function escapeTextForBrowser(text: string | number | boolean): string {
if (
typeof text === 'boolean' ||
typeof text === 'number' ||
- (enableBigIntSupport && typeof text === 'bigint')
+ typeof text === 'bigint'
) {
// this shortcircuit helps perf for types that we know will never have
// special characters, especially given that this function is used often
diff --git a/packages/react-dom/src/__tests__/ReactDOMFiber-test.js b/packages/react-dom/src/__tests__/ReactDOMFiber-test.js
index f135bd288d19f..a1633fa1e625c 100644
--- a/packages/react-dom/src/__tests__/ReactDOMFiber-test.js
+++ b/packages/react-dom/src/__tests__/ReactDOMFiber-test.js
@@ -60,7 +60,6 @@ describe('ReactDOMFiber', () => {
expect(container.textContent).toEqual('10');
});
- // @gate enableBigIntSupport
it('should render bigints as children', async () => {
const Box = ({value}) =>
{value}
;
diff --git a/packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js b/packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js
index 2949443871c65..6064ad9312e87 100644
--- a/packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js
+++ b/packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js
@@ -3377,7 +3377,6 @@ describe('ReactDOMFizzServer', () => {
);
});
- // @gate enableBigIntSupport
it('Supports bigint', async () => {
await act(async () => {
const {pipe} = ReactDOMFizzServer.renderToPipeableStream(
@@ -5732,9 +5731,7 @@ describe('ReactDOMFizzServer', () => {
pipe(writable);
});
}).toErrorDev([
- 'React expects the `children` prop of tags to be a string, number' +
- gate(flags => (flags.enableBigIntSupport ? ', bigint' : '')) +
- ', or object with a novel `toString` method but found an Array with length 2 instead. Browsers treat all child Nodes of tags as Text content and React expects to be able to convert `children` of tags to a single string value which is why Arrays of length greater than 1 are not supported. When using JSX it can be commong to combine text nodes and value nodes. For example: hello {nameOfUser}. While not immediately apparent, `children` in this case is an Array with length 2. If your `children` prop is using this form try rewriting it using a template string: {`hello ${nameOfUser}`}.',
+ 'React expects the `children` prop of tags to be a string, number, bigint, or object with a novel `toString` method but found an Array with length 2 instead. Browsers treat all child Nodes of tags as Text content and React expects to be able to convert `children` of tags to a single string value which is why Arrays of length greater than 1 are not supported. When using JSX it can be commong to combine text nodes and value nodes. For example: hello {nameOfUser}. While not immediately apparent, `children` in this case is an Array with length 2. If your `children` prop is using this form try rewriting it using a template string: {`hello ${nameOfUser}`}.',
]);
expect(getVisibleChildren(document.head)).toEqual();
@@ -5771,9 +5768,7 @@ describe('ReactDOMFizzServer', () => {
pipe(writable);
});
}).toErrorDev([
- 'React expects the `children` prop of tags to be a string, number' +
- gate(flags => (flags.enableBigIntSupport ? ', bigint' : '')) +
- ', or object with a novel `toString` method but found an object that appears to be a React element which never implements a suitable `toString` method. Browsers treat all child Nodes of tags as Text content and React expects to be able to convert children of tags to a single string value which is why rendering React elements is not supported. If the `children` of is a React Component try moving the tag into that component. If the `children` of is some HTML markup change it to be Text only to be valid HTML.',
+ 'React expects the `children` prop of tags to be a string, number, bigint, or object with a novel `toString` method but found an object that appears to be a React element which never implements a suitable `toString` method. Browsers treat all child Nodes of tags as Text content and React expects to be able to convert children of tags to a single string value which is why rendering React elements is not supported. If the `children` of is a React Component try moving the tag into that component. If the `children` of is some HTML markup change it to be Text only to be valid HTML.',
]);
// object titles are toStringed when float is on
expect(getVisibleChildren(document.head)).toEqual(
@@ -5808,9 +5803,7 @@ describe('ReactDOMFizzServer', () => {
pipe(writable);
});
}).toErrorDev([
- 'React expects the `children` prop of tags to be a string, number' +
- gate(flags => (flags.enableBigIntSupport ? ', bigint' : '')) +
- ', or object with a novel `toString` method but found an object that does not implement a suitable `toString` method. Browsers treat all child Nodes of tags as Text content and React expects to be able to convert children of tags to a single string value. Using the default `toString` method available on every object is almost certainly an error. Consider whether the `children` of this is an object in error and change it to a string or number value if so. Otherwise implement a `toString` method that React can use to produce a valid .',
+ 'React expects the `children` prop of tags to be a string, number, bigint, or object with a novel `toString` method but found an object that does not implement a suitable `toString` method. Browsers treat all child Nodes of tags as Text content and React expects to be able to convert children of tags to a single string value. Using the default `toString` method available on every object is almost certainly an error. Consider whether the `children` of this is an object in error and change it to a string or number value if so. Otherwise implement a `toString` method that React can use to produce a valid .',
]);
// object titles are toStringed when float is on
expect(getVisibleChildren(document.head)).toEqual(
diff --git a/packages/react-dom/src/__tests__/ReactDOMInput-test.js b/packages/react-dom/src/__tests__/ReactDOMInput-test.js
index f817ede5214ca..8b0dd3274d714 100644
--- a/packages/react-dom/src/__tests__/ReactDOMInput-test.js
+++ b/packages/react-dom/src/__tests__/ReactDOMInput-test.js
@@ -846,7 +846,6 @@ describe('ReactDOMInput', () => {
expect(node.value).toBe('0');
});
- // @gate enableBigIntSupport
it('should display `value` of bigint 5', async () => {
await act(() => {
root.render();
diff --git a/packages/react-dom/src/__tests__/ReactDOMOption-test.js b/packages/react-dom/src/__tests__/ReactDOMOption-test.js
index 8743c5993ddbe..1661a98b1a694 100644
--- a/packages/react-dom/src/__tests__/ReactDOMOption-test.js
+++ b/packages/react-dom/src/__tests__/ReactDOMOption-test.js
@@ -171,7 +171,6 @@ describe('ReactDOMOption', () => {
expect(container.firstChild.value).toBe('hello');
});
- // @gate enableBigIntSupport
it('should support bigint values', async () => {
const container = await renderIntoDocument();
expect(container.firstChild.innerHTML).toBe('5');
diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationBasic-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationBasic-test.js
index 266bae3d5eeaa..6323fe9b60c02 100644
--- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationBasic-test.js
+++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationBasic-test.js
@@ -74,12 +74,8 @@ describe('ReactDOMServerIntegration', () => {
itRenders('a bigint', async render => {
const e = await render(42n);
- if (gate(flags => flags.enableBigIntSupport)) {
- expect(e.nodeType).toBe(3);
- expect(e.nodeValue).toMatch('42');
- } else {
- expect(e).toBe(null);
- }
+ expect(e.nodeType).toBe(3);
+ expect(e.nodeValue).toMatch('42');
});
itRenders('an array with one child', async render => {
diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationInput-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationInput-test.js
index 9f16ed58a7617..7066aea04baf7 100644
--- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationInput-test.js
+++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationInput-test.js
@@ -32,8 +32,7 @@ function initModules() {
};
}
-const {resetModules, itRenders, serverRender, streamRender} =
- ReactDOMServerIntegrationUtils(initModules);
+const {resetModules, itRenders} = ReactDOMServerIntegrationUtils(initModules);
// TODO: Run this in React Fire mode after we figure out the SSR behavior.
const desc = disableInputAttributeSyncing ? xdescribe : describe;
@@ -49,13 +48,7 @@ desc('ReactDOMServerIntegrationInput', () => {
itRenders('an input with a bigint value and an onChange', async render => {
const e = await render( {}} />);
- expect(e.value).toBe(
- gate(flags => flags.enableBigIntSupport) ||
- render === serverRender ||
- render === streamRender
- ? '5'
- : '',
- );
+ expect(e.value).toBe('5');
});
itRenders('an input with a value and readOnly', async render => {
diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationSelect-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationSelect-test.js
index 9b20b1edcd216..664914a436685 100644
--- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationSelect-test.js
+++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationSelect-test.js
@@ -224,9 +224,7 @@ describe('ReactDOMServerIntegrationSelect', () => {
,
);
const option = e.options[0];
- expect(option.textContent).toBe(
- gate(flags => flags.enableBigIntSupport) ? 'A B 5' : 'A B ',
- );
+ expect(option.textContent).toBe('A B 5');
expect(option.value).toBe('bar');
expect(option.selected).toBe(true);
});
diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationTextarea-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationTextarea-test.js
index 79b5fd840d88a..9ce04840dbb0f 100644
--- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationTextarea-test.js
+++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationTextarea-test.js
@@ -30,8 +30,7 @@ function initModules() {
};
}
-const {resetModules, itRenders, serverRender, streamRender} =
- ReactDOMServerIntegrationUtils(initModules);
+const {resetModules, itRenders} = ReactDOMServerIntegrationUtils(initModules);
describe('ReactDOMServerIntegrationTextarea', () => {
beforeEach(() => {
@@ -51,13 +50,7 @@ describe('ReactDOMServerIntegrationTextarea', () => {
itRenders('a textarea with a bigint value and an onChange', async render => {
const e = await render(