Skip to content

Commit 18e317b

Browse files
committed
Manual touch ups
A few manual changes I made after the codemod ran.
1 parent 2e22ec7 commit 18e317b

23 files changed

+25
-60
lines changed

packages/react-art/src/ReactARTHostConfig.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,6 @@ export function appendInitialChild(parentInstance, child) {
248248
if (typeof child === 'string') {
249249
// Noop for string children of Text (eg <Text>{'foo'}{'bar'}</Text>)
250250
throw new Error('Text children should already be flattened.');
251-
252-
return;
253251
}
254252

255253
child.inject(parentInstance);

packages/react-client/src/ReactFlightClientHostConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @flow
88
*/
99

10-
/* eslint-disable react-internal/invariant-args */
10+
/* eslint-disable react-internal/prod-error-codes */
1111

1212
// We expect that our Rollup, Jest, and Flow configurations
1313
// always shim this module with the corresponding host config

packages/react-dom/src/client/ReactDOMTextarea.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ export function initWrapperState(element: Element, props: Object) {
104104
}
105105

106106
if (isArray(children)) {
107-
// FIXME: Review this condition before merging
108-
// Should be equivalent to: !(children.length <= 1)
109107
if (children.length > 1) {
110108
throw new Error('<textarea> can only have at most one child.');
111109
}

packages/react-dom/src/server/ReactDOMServerFormatConfig.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -920,8 +920,6 @@ function pushStartTextArea(
920920
}
921921

922922
if (isArray(children)) {
923-
// FIXME: Review this condition before merging
924-
// Should be equivalent to: !(children.length <= 1)
925923
if (children.length > 1) {
926924
throw new Error('<textarea> can only have at most one child.');
927925
}

packages/react-dom/src/server/ReactPartialRenderer.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -980,8 +980,6 @@ class ReactDOMServerRenderer {
980980
} catch (err) {
981981
if (err != null && typeof err.then === 'function') {
982982
if (enableSuspenseServerRenderer) {
983-
// FIXME: Review this condition before merging
984-
// Should be equivalent to: !(this.suspenseDepth > 0)
985983
if (this.suspenseDepth <= 0) {
986984
throw new Error(
987985
// TODO: include component name. This is a bit tricky with current factoring.
@@ -1481,8 +1479,6 @@ class ReactDOMServerRenderer {
14811479
}
14821480

14831481
if (isArray(textareaChildren)) {
1484-
// FIXME: Review this condition before merging
1485-
// Should be equivalent to: !(textareaChildren.length <= 1)
14861482
if (textareaChildren.length > 1) {
14871483
throw new Error('<textarea> can only have at most one child.');
14881484
}

packages/react-dom/src/server/ReactPartialRendererHooks.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,6 @@ function dispatchAction<A>(
424424
queue: UpdateQueue<A>,
425425
action: A,
426426
) {
427-
// FIXME: Review this condition before merging
428-
// Should be equivalent to: !(numberOfReRenders < RE_RENDER_LIMIT)
429427
if (numberOfReRenders >= RE_RENDER_LIMIT) {
430428
throw new Error(
431429
'Too many re-renders. React limits the number of renders to prevent ' +

packages/react-dom/src/server/ReactThreadIDAllocator.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ function growThreadCountAndReturnNextAvailable() {
2424
const oldSize = oldArray.length;
2525
const newSize = oldSize * 2;
2626

27-
// FIXME: Review this condition before merging
28-
// Should be equivalent to: !(newSize <= 0x10000)
2927
if (newSize > 0x10000) {
3028
throw new Error(
3129
'Maximum number of concurrent React renderers exceeded. ' +

packages/react-native-renderer/src/ReactNativeBridgeEventPlugin.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ const ReactNativeBridgeEventPlugin = {
150150

151151
if (!bubbleDispatchConfig && !directDispatchConfig) {
152152
throw new Error(
153+
// $FlowFixMe - Flow doesn't like this string coercion because DOMTopLevelEventType is opaque
153154
`Unsupported top level event type "${topLevelType}" dispatched`,
154155
);
155156
}

packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/UIManager.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ function insertSubviewAtIndex(parent, child, index) {
4040
);
4141
}
4242

43-
// FIXME: Review this condition before merging
44-
// Should be equivalent to: !(0 <= index && index <= parentInfo.children.length)
4543
if (0 > index || index > parentInfo.children.length) {
4644
throw new Error(
4745
`Invalid index ${index} for children ${parentInfo.children}`,
@@ -57,8 +55,6 @@ function removeChild(parent, child) {
5755
const childInfo = views.get(child);
5856
const index = parentInfo.children.indexOf(child);
5957

60-
// FIXME: Review this condition before merging
61-
// Should be equivalent to: !(index >= 0)
6258
if (index < 0) {
6359
throw new Error(`Missing view ${child} during removal`);
6460
}

packages/react-native-renderer/src/legacy-events/EventPluginRegistry.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ function recomputePluginOrdering(): void {
4444
const pluginModule = namesToPlugins[pluginName];
4545
const pluginIndex = eventPluginOrder.indexOf(pluginName);
4646

47-
// FIXME: Review this condition before merging
48-
// Should be equivalent to: !(pluginIndex > -1)
4947
if (pluginIndex <= -1) {
5048
throw new Error(
5149
'EventPluginRegistry: Cannot inject event plugins that do not exist in ' +

0 commit comments

Comments
 (0)