Skip to content

Commit f6fef6a

Browse files
committed
Manual touch ups
A few manual changes I made after the codemod ran.
1 parent 4e6bd45 commit f6fef6a

File tree

18 files changed

+20
-55
lines changed

18 files changed

+20
-55
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-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
@@ -896,8 +896,6 @@ function pushStartTextArea(
896896
}
897897

898898
if (isArray(children)) {
899-
// FIXME: Review this condition before merging
900-
// Should be equivalent to: !(children.length <= 1)
901899
if (children.length > 1) {
902900
throw new Error('<textarea> can only have at most one child.');
903901
}

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -976,8 +976,6 @@ class ReactDOMServerRenderer {
976976
} catch (err) {
977977
if (err != null && typeof err.then === 'function') {
978978
if (enableSuspenseServerRenderer) {
979-
// FIXME: Review this condition before merging
980-
// Should be equivalent to: !(this.suspenseDepth > 0)
981979
if (this.suspenseDepth <= 0) {
982980
throw new Error(
983981
// TODO: include component name. This is a bit tricky with current factoring.
@@ -1477,8 +1475,6 @@ class ReactDOMServerRenderer {
14771475
}
14781476

14791477
if (isArray(textareaChildren)) {
1480-
// FIXME: Review this condition before merging
1481-
// Should be equivalent to: !(textareaChildren.length <= 1)
14821478
if (textareaChildren.length > 1) {
14831479
throw new Error('<textarea> can only have at most one child.');
14841480
}

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 ' +

packages/react-reconciler/src/ReactChildFiber.new.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ function coerceRef(
169169
'bug in React. Please file an issue.',
170170
);
171171
}
172+
// Assigning this to a const so Flow knows it won't change in the closure
173+
const resolvedInst = inst;
172174

173175
const stringRef = '' + mixedRef;
174176
// Check if previous string ref matches new string ref
@@ -181,10 +183,10 @@ function coerceRef(
181183
return current.ref;
182184
}
183185
const ref = function(value) {
184-
let refs = inst.refs;
186+
let refs = resolvedInst.refs;
185187
if (refs === emptyRefsObject) {
186188
// This is a lazy pooled frozen object, so we need to initialize.
187-
refs = inst.refs = {};
189+
refs = resolvedInst.refs = {};
188190
}
189191
if (value === null) {
190192
delete refs[stringRef];

0 commit comments

Comments
 (0)