Skip to content
Permalink
Browse files

Bump Prettier (#17811)

* Bump Prettier

* Reformat

* Use non-deprecated option
  • Loading branch information
gaearon committed Jan 9, 2020
1 parent 18875b2 commit b979db4e7215957f03c4221622f0b115a868439a
Showing with 2,341 additions and 2,392 deletions.
  1. +1 −1 .prettierrc.js
  2. +5 −9 fixtures/attribute-behavior/src/App.js
  3. +1 −1 fixtures/dom/src/components/Iframe.js
  4. +2 −1 fixtures/dom/src/components/fixtures/home.js
  5. +5 −3 fixtures/dom/src/components/fixtures/suspense/index.js
  6. +1 −3 fixtures/dom/src/toWarnDev.js
  7. +15 −18 fixtures/eslint/index.js
  8. +1 −2 fixtures/fiber-debugger/src/App.js
  9. +70 −77 fixtures/fiber-debugger/src/Fibers.js
  10. +1 −1 package.json
  11. +8 −2 packages/create-subscription/src/__tests__/createSubscription-test.internal.js
  12. +6 −18 packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js
  13. +4 −4 packages/legacy-events/EventPluginUtils.js
  14. +2 −1 packages/legacy-events/ReactGenericBatching.js
  15. +10 −10 packages/legacy-events/ResponderEventPlugin.js
  16. +6 −6 packages/legacy-events/__tests__/ResponderEventPlugin-test.internal.js
  17. +3 −1 packages/react-art/src/__tests__/ReactART-test.js
  18. +66 −56 packages/react-cache/src/__tests__/ReactCache-test.internal.js
  19. +2 −2 packages/react-debug-tools/src/ReactDebugHooks.js
  20. +2 −5 packages/react-devtools-core/src/backend.js
  21. +8 −2 packages/react-devtools-shared/src/__tests__/inspectedElementContext-test.js
  22. +8 −2 packages/react-devtools-shared/src/__tests__/legacy/inspectElement-test.js
  23. +18 −6 packages/react-devtools-shared/src/__tests__/legacy/storeLegacy-v15-test.js
  24. +3 −3 packages/react-devtools-shared/src/backend/views/Highlighter/index.js
  25. +34 −40 packages/react-devtools-shared/src/devtools/ContextMenu/ContextMenu.js
  26. +20 −25 packages/react-devtools-shared/src/devtools/ContextMenu/useContextMenu.js
  27. +1 −3 packages/react-devtools-shared/src/devtools/store.js
  28. +1 −3 packages/react-devtools-shared/src/devtools/utils.js
  29. +3 −6 packages/react-devtools-shared/src/devtools/views/Components/Element.js
  30. +6 −9 packages/react-devtools-shared/src/devtools/views/Components/InspectHostNodesToggle.js
  31. +141 −148 packages/react-devtools-shared/src/devtools/views/Components/InspectedElementContext.js
  32. +11 −14 packages/react-devtools-shared/src/devtools/views/Components/KeyValue.js
  33. +15 −18 packages/react-devtools-shared/src/devtools/views/Components/NativeStyleEditor/AutoSizeInput.js
  34. +68 −74 packages/react-devtools-shared/src/devtools/views/Components/NativeStyleEditor/context.js
  35. +39 −48 packages/react-devtools-shared/src/devtools/views/Components/OwnersListContext.js
  36. +26 −32 packages/react-devtools-shared/src/devtools/views/Components/OwnersStack.js
  37. +20 −24 packages/react-devtools-shared/src/devtools/views/Components/SearchInput.js
  38. +91 −105 packages/react-devtools-shared/src/devtools/views/Components/SelectedElement.js
  39. +110 −128 packages/react-devtools-shared/src/devtools/views/Components/Tree.js
  40. +40 −49 packages/react-devtools-shared/src/devtools/views/Components/TreeContext.js
  41. +9 −12 packages/react-devtools-shared/src/devtools/views/DevTools.js
  42. +5 −8 packages/react-devtools-shared/src/devtools/views/ModalDialog.js
  43. +20 −26 packages/react-devtools-shared/src/devtools/views/Profiler/CommitFlamegraph.js
  44. +3 −3 packages/react-devtools-shared/src/devtools/views/Profiler/CommitTreeBuilder.js
  45. +3 −6 packages/react-devtools-shared/src/devtools/views/Profiler/InteractionListItem.js
  46. +28 −31 packages/react-devtools-shared/src/devtools/views/Profiler/Interactions.js
  47. +4 −3 packages/react-devtools-shared/src/devtools/views/Profiler/ProfilerContext.js
  48. +58 −64 packages/react-devtools-shared/src/devtools/views/Profiler/ProfilingImportExportButtons.js
  49. +12 −14 packages/react-devtools-shared/src/devtools/views/Profiler/ReloadAndProfileButton.js
  50. +18 −24 packages/react-devtools-shared/src/devtools/views/Profiler/SnapshotCommitList.js
  51. +22 −31 packages/react-devtools-shared/src/devtools/views/Profiler/SnapshotSelector.js
  52. +6 −9 packages/react-devtools-shared/src/devtools/views/Settings/ComponentsSettings.js
  53. +59 −72 packages/react-devtools-shared/src/devtools/views/Settings/SettingsContext.js
  54. +5 −8 packages/react-devtools-shared/src/devtools/views/Settings/SettingsModal.js
  55. +25 −27 packages/react-devtools-shared/src/devtools/views/UnsupportedVersionDialog.js
  56. +46 −49 packages/react-devtools-shared/src/devtools/views/WarnIfLegacyBackendDetected.js
  57. +106 −121 packages/react-devtools-shared/src/devtools/views/hooks.js
  58. +10 −2 packages/react-devtools-shell/src/app/Hydration/index.js
  59. +8 −2 packages/react-devtools-shell/src/app/InspectableElements/UnserializableProps.js
  60. +39 −51 packages/react-devtools-shell/src/app/InteractionTracing/index.js
  61. +14 −17 packages/react-devtools-shell/src/app/ToDoList/List.js
  62. +6 −12 packages/react-devtools-shell/src/app/ToDoList/ListItem.js
  63. +7 −9 packages/react-dom/src/__tests__/ReactComponentLifeCycle-test.js
  64. +3 −1 packages/react-dom/src/__tests__/ReactCompositeComponent-test.js
  65. +3 −6 packages/react-dom/src/__tests__/ReactDOMComponent-test.js
  66. +6 −2 packages/react-dom/src/__tests__/ReactDOMComponentTree-test.js
  67. +6 −2 packages/react-dom/src/__tests__/ReactDOMFiber-test.js
  68. +5 −8 packages/react-dom/src/__tests__/ReactDOMFiberAsync-test.internal.js
  69. +1 −4 packages/react-dom/src/__tests__/ReactDOMServerIntegrationAttributes-test.js
  70. +22 −17 packages/react-dom/src/__tests__/ReactDOMServerIntegrationElements-test.js
  71. +12 −21 packages/react-dom/src/__tests__/ReactDOMServerIntegrationHooks-test.internal.js
  72. +10 −7 packages/react-dom/src/__tests__/ReactDOMSuspensePlaceholder-test.js
  73. +5 −5 packages/react-dom/src/__tests__/ReactFunctionComponent-test.js
  74. +12 −4 packages/react-dom/src/__tests__/ReactMount-test.js
  75. +6 −2 packages/react-dom/src/__tests__/ReactMountDestruction-test.js
  76. +23 −8 packages/react-dom/src/__tests__/ReactMultiChild-test.js
  77. +3 −1 packages/react-dom/src/__tests__/ReactRenderDocument-test.js
  78. +6 −2 packages/react-dom/src/__tests__/ReactServerRendering-test.js
  79. +3 −1 packages/react-dom/src/__tests__/ReactTestUtils-test.js
  80. +7 −13 packages/react-dom/src/__tests__/ReactTestUtilsAct-test.js
  81. +4 −7 packages/react-dom/src/__tests__/ReactTestUtilsActUnmockedScheduler-test.js
  82. +5 −5 packages/react-dom/src/__tests__/renderSubtreeIntoContainer-test.js
  83. +2 −2 packages/react-dom/src/client/ReactDOMLegacy.js
  84. +2 −2 packages/react-dom/src/events/SelectEventPlugin.js
  85. +9 −9 packages/react-dom/src/events/SyntheticWheelEvent.js
  86. +1 −3 packages/react-dom/src/events/__tests__/SimpleEventPlugin-test.internal.js
  87. +15 −14 packages/react-dom/src/events/__tests__/SyntheticEvent-test.js
  88. +12 −15 packages/react-interactions/accessibility/src/FocusContain.js
  89. +3 −3 packages/react-interactions/events/src/dom/Press.js
  90. +7 −4 packages/react-interactions/events/src/dom/PressLegacy.js
  91. +4 −5 packages/react-native-renderer/src/ReactNativeHostConfig.js
  92. +13 −7 packages/react-native-renderer/src/__tests__/ReactFabric-test.internal.js
  93. +6 −10 packages/react-native-renderer/src/__tests__/ReactFabricAndNative-test.internal.js
  94. +8 −6 packages/react-native-renderer/src/__tests__/ReactNativeMount-test.internal.js
  95. +3 −1 packages/react-reconciler/src/ReactFiberBeginWork.js
  96. +2 −5 packages/react-reconciler/src/ReactFiberCommitWork.js
  97. +2 −4 packages/react-reconciler/src/ReactFiberCompleteWork.js
  98. +18 −24 packages/react-reconciler/src/ReactFiberHooks.js
  99. +2 −2 packages/react-reconciler/src/ReactFiberRoot.js
  100. +10 −10 packages/react-reconciler/src/ReactFiberWorkLoop.js
  101. +11 −8 packages/react-reconciler/src/__tests__/ReactBatchedMode-test.internal.js
  102. +2 −2 packages/react-reconciler/src/__tests__/ReactFragment-test.js
  103. +11 −5 packages/react-reconciler/src/__tests__/ReactHooks-test.internal.js
  104. +49 −67 packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.internal.js
  105. +27 −9 packages/react-reconciler/src/__tests__/ReactIncremental-test.internal.js
  106. +6 −2 packages/react-reconciler/src/__tests__/ReactIncrementalErrorHandling-test.internal.js
  107. +5 −3 packages/react-reconciler/src/__tests__/ReactIncrementalReflection-test.internal.js
  108. +3 −6 packages/react-reconciler/src/__tests__/ReactIncrementalScheduling-test.internal.js
  109. +4 −4 packages/react-reconciler/src/__tests__/ReactIncrementalSideEffects-test.internal.js
  110. +16 −17 packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.internal.js
  111. +1 −3 packages/react-reconciler/src/__tests__/ReactLazy-test.internal.js
  112. +6 −2 packages/react-reconciler/src/__tests__/ReactMemo-test.internal.js
  113. +4 −6 packages/react-reconciler/src/__tests__/ReactNewContext-test.internal.js
  114. +2 −2 packages/react-reconciler/src/__tests__/ReactPersistent-test.js
  115. +1 −2 packages/react-reconciler/src/__tests__/ReactSchedulerIntegration-test.internal.js
  116. +48 −44 packages/react-reconciler/src/__tests__/ReactSuspense-test.internal.js
  117. +44 −50 packages/react-reconciler/src/__tests__/ReactSuspenseFuzz-test.internal.js
  118. +81 −10 packages/react-reconciler/src/__tests__/ReactSuspenseList-test.internal.js
  119. +45 −38 packages/react-reconciler/src/__tests__/ReactSuspensePlaceholder-test.internal.js
  120. +46 −54 packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.internal.js
  121. +4 −2 packages/react-refresh/src/__tests__/ReactFresh-test.js
  122. +9 −7 packages/react-test-renderer/src/ReactShallowRenderer.js
  123. +2 −2 packages/react/src/ReactHooks.js
  124. +19 −25 packages/react/src/__tests__/ReactDOMTracing-test.internal.js
  125. +6 −2 packages/react/src/__tests__/ReactES6Class-test.js
  126. +4 −2 packages/react/src/__tests__/ReactElement-test.js
  127. +3 −1 packages/react/src/__tests__/ReactElementJSX-test.internal.js
  128. +6 −4 packages/react/src/__tests__/ReactElementValidator-test.internal.js
  129. +11 −5 packages/react/src/__tests__/ReactJSXElementValidator-test.js
  130. +19 −13 packages/react/src/__tests__/ReactProfiler-test.internal.js
  131. +9 −3 packages/react/src/__tests__/ReactStrictMode-test.js
  132. +6 −5 packages/react/src/__tests__/createReactClassIntegration-test.internal.js
  133. +6 −2 packages/react/src/__tests__/createReactClassIntegration-test.js
  134. +24 −8 packages/react/src/__tests__/forwardRef-test.js
  135. +2 −2 packages/scheduler/npm/umd/scheduler-tracing.development.js
  136. +2 −2 packages/scheduler/npm/umd/scheduler-tracing.production.min.js
  137. +2 −2 packages/scheduler/npm/umd/scheduler-tracing.profiling.min.js
  138. +2 −2 packages/scheduler/npm/umd/scheduler.development.js
  139. +2 −2 packages/scheduler/npm/umd/scheduler.production.min.js
  140. +2 −2 packages/scheduler/npm/umd/scheduler.profiling.min.js
  141. +3 −3 packages/scheduler/src/SchedulerProfiling.js
  142. +29 −5 packages/scheduler/src/__tests__/Scheduler-test.js
  143. +1 −1 packages/shared/objectIs.js
  144. +50 −53 packages/use-subscription/src/useSubscription.js
  145. +1 −3 scripts/jest/matchers/interactionTracingMatchers.js
  146. +1 −3 scripts/jest/matchers/profilerMatchers.js
  147. +1 −3 scripts/jest/matchers/toWarnDev.js
  148. +6 −18 scripts/jest/setupHostConfigs.js
  149. +1 −3 scripts/release/create-canary-commands/copy-repo-to-temp-directory.js
  150. +2 −6 scripts/release/create-canary-commands/npm-pack-and-unpack.js
  151. +1 −3 scripts/release/prepare-stable-commands/update-stable-version-numbers.js
  152. +2 −6 scripts/release/publish-commands/publish-to-npm.js
  153. +2 −6 scripts/release/shared-commands/download-build-artifacts.js
  154. +3 −9 scripts/release/utils.js
  155. +4 −12 scripts/rollup/forks.js
  156. +3 −3 scripts/rollup/packaging.js
  157. +24 −24 scripts/rollup/wrappers.js
  158. +7 −1 yarn.lock
@@ -8,7 +8,7 @@ module.exports = {
jsxBracketSameLine: true,
trailingComma: 'es5',
printWidth: 80,
parser: 'babylon',
parser: 'babel',

overrides: [
{
@@ -461,9 +461,7 @@ function prepareState(initGlobals) {
hasSameBehaviorForAll,
rowPatternHash,
// "Good enough" id that we can store in localStorage
rowIdHash: `${attribute.name} ${attribute.tagName} ${
attribute.overrideStringValue
}`,
rowIdHash: `${attribute.name} ${attribute.tagName} ${attribute.overrideStringValue}`,
};
const rowGroup = rowPatternHashes.get(rowPatternHash) || new Set();
rowGroup.add(row);
@@ -866,14 +864,12 @@ class App extends React.Component {
// Sort
switch (sortOrder) {
case ALPHABETICAL:
return filteredAttributes.sort(
(attr1, attr2) =>
attr1.name.toLowerCase() < attr2.name.toLowerCase() ? -1 : 1
return filteredAttributes.sort((attr1, attr2) =>
attr1.name.toLowerCase() < attr2.name.toLowerCase() ? -1 : 1
);
case REV_ALPHABETICAL:
return filteredAttributes.sort(
(attr1, attr2) =>
attr1.name.toLowerCase() < attr2.name.toLowerCase() ? 1 : -1
return filteredAttributes.sort((attr1, attr2) =>
attr1.name.toLowerCase() < attr2.name.toLowerCase() ? 1 : -1
);
case GROUPED_BY_ROW_PATTERN: {
return filteredAttributes.sort((attr1, attr2) => {
@@ -55,4 +55,4 @@ class IframeSubtree extends React.Component {
}
}

export default (ReactDOM.createPortal ? IframePortal : IframeSubtree);
export default ReactDOM.createPortal ? IframePortal : IframeSubtree;
@@ -33,7 +33,8 @@ export default function Home() {
<td>
<a href="https://www.mozilla.org/en-US/firefox/organizations/">
ESR<sup></sup>
</a>, Latest
</a>
, Latest
</td>
</tr>
<tr>
@@ -213,8 +213,8 @@ class TextInputFixtures extends React.Component {

<Fixture>
<SuspendyTree>
<img src="https://upload.wikimedia.org/wikipedia/commons/e/ee/Atom_%282%29.png" />React
is cool
<img src="https://upload.wikimedia.org/wikipedia/commons/e/ee/Atom_%282%29.png" />
React is cool
</SuspendyTree>
</Fixture>
</TestCase>
@@ -308,7 +308,9 @@ class TextInputFixtures extends React.Component {
<div style={{height: 200, overflow: 'scroll'}}>
{Array(20)
.fill()
.map((_, i) => <h2 key={i}>{i + 1}</h2>)}
.map((_, i) => (
<h2 key={i}>{i + 1}</h2>
))}
</div>
</SuspendyTree>
</Fixture>
@@ -205,9 +205,7 @@ const createMatcherFor = consoleMethod =>
if (withoutStack !== warningsWithoutComponentStack.length) {
return {
message: () =>
`Expected ${withoutStack} warnings without a component stack but received ${
warningsWithoutComponentStack.length
}:\n` +
`Expected ${withoutStack} warnings without a component stack but received ${warningsWithoutComponentStack.length}:\n` +
warningsWithoutComponentStack.map(warning =>
this.utils.printReceived(warning)
),
@@ -8,22 +8,19 @@ function Comment({comment, commentSource}) {
const currentUserID = comment.viewer.id;
const environment = RelayEnvironment.forUser(currentUserID);
const commentID = nullthrows(comment.id);
useEffect(
() => {
const subscription = SubscriptionCounter.subscribeOnce(
`StoreSubscription_${commentID}`,
() =>
StoreSubscription.subscribe(
environment,
{
comment_id: commentID,
},
currentUserID,
commentSource
)
);
return () => subscription.dispose();
},
[commentID, commentSource, currentUserID, environment]
);
useEffect(() => {
const subscription = SubscriptionCounter.subscribeOnce(
`StoreSubscription_${commentID}`,
() =>
StoreSubscription.subscribe(
environment,
{
comment_id: commentID,
},
currentUserID,
commentSource
)
);
return () => subscription.dispose();
}, [commentID, commentSource, currentUserID, environment]);
}
@@ -192,8 +192,7 @@ class App extends Component {
}
/>
<p>
Step {currentStep}
: {friendlyAction} (
Step {currentStep}: {friendlyAction} (
<a style={{color: 'gray'}} onClick={this.handleEdit} href="#">
Edit
</a>
@@ -330,83 +330,76 @@ export default function Fibers({fibers, show, graphSettings, ...rest}) {
]}
</div>
</Vertex>,
fiber.child &&
show.child && (
<Edge
source={fiber.id}
target={fiber.child}
kind="child"
weight={1000}
key={`${fiber.id}-${fiber.child}-child`}>
child
</Edge>
),
fiber.sibling &&
show.sibling && (
<Edge
source={fiber.id}
target={fiber.sibling}
kind="sibling"
weight={2000}
key={`${fiber.id}-${fiber.sibling}-sibling`}>
sibling
</Edge>
),
fiber.return &&
show.return && (
<Edge
source={fiber.id}
target={fiber.return}
kind="return"
weight={1000}
key={`${fiber.id}-${fiber.return}-return`}>
return
</Edge>
),
fiber.nextEffect &&
show.fx && (
<Edge
source={fiber.id}
target={fiber.nextEffect}
kind="fx"
weight={100}
key={`${fiber.id}-${fiber.nextEffect}-nextEffect`}>
nextFx
</Edge>
),
fiber.firstEffect &&
show.fx && (
<Edge
source={fiber.id}
target={fiber.firstEffect}
kind="fx"
weight={100}
key={`${fiber.id}-${fiber.firstEffect}-firstEffect`}>
firstFx
</Edge>
),
fiber.lastEffect &&
show.fx && (
<Edge
source={fiber.id}
target={fiber.lastEffect}
kind="fx"
weight={100}
key={`${fiber.id}-${fiber.lastEffect}-lastEffect`}>
lastFx
</Edge>
),
fiber.alternate &&
show.alt && (
<Edge
source={fiber.id}
target={fiber.alternate}
kind="alt"
weight={10}
key={`${fiber.id}-${fiber.alternate}-alt`}>
alt
</Edge>
),
fiber.child && show.child && (
<Edge
source={fiber.id}
target={fiber.child}
kind="child"
weight={1000}
key={`${fiber.id}-${fiber.child}-child`}>
child
</Edge>
),
fiber.sibling && show.sibling && (
<Edge
source={fiber.id}
target={fiber.sibling}
kind="sibling"
weight={2000}
key={`${fiber.id}-${fiber.sibling}-sibling`}>
sibling
</Edge>
),
fiber.return && show.return && (
<Edge
source={fiber.id}
target={fiber.return}
kind="return"
weight={1000}
key={`${fiber.id}-${fiber.return}-return`}>
return
</Edge>
),
fiber.nextEffect && show.fx && (
<Edge
source={fiber.id}
target={fiber.nextEffect}
kind="fx"
weight={100}
key={`${fiber.id}-${fiber.nextEffect}-nextEffect`}>
nextFx
</Edge>
),
fiber.firstEffect && show.fx && (
<Edge
source={fiber.id}
target={fiber.firstEffect}
kind="fx"
weight={100}
key={`${fiber.id}-${fiber.firstEffect}-firstEffect`}>
firstFx
</Edge>
),
fiber.lastEffect && show.fx && (
<Edge
source={fiber.id}
target={fiber.lastEffect}
kind="fx"
weight={100}
key={`${fiber.id}-${fiber.lastEffect}-lastEffect`}>
lastFx
</Edge>
),
fiber.alternate && show.alt && (
<Edge
source={fiber.id}
target={fiber.alternate}
kind="alt"
weight={10}
key={`${fiber.id}-${fiber.alternate}-alt`}>
alt
</Edge>
),
])}
</Graph>
</div>
@@ -71,7 +71,7 @@
"ncp": "^2.0.0",
"object-assign": "^4.1.1",
"pacote": "^9.5.6",
"prettier": "1.13.7",
"prettier": "1.19.1",
"prop-types": "^15.6.2",
"random-seed": "^0.3.0",
"react-lifecycles-compat": "^3.0.2",
@@ -118,7 +118,10 @@ describe('createSubscription', () => {
const Subscription = createSubscription({
getCurrentValue: source => undefined,
subscribe: (source, callback) => {
source.then(value => callback(value), value => callback(value));
source.then(
value => callback(value),
value => callback(value),
);
// (Can't unsubscribe from a Promise)
return () => {};
},
@@ -196,7 +199,10 @@ describe('createSubscription', () => {
const Subscription = createSubscription({
getCurrentValue: source => undefined,
subscribe: (source, callback) => {
source.then(value => callback(value), value => callback(value));
source.then(
value => callback(value),
value => callback(value),
);
// (Can't unsubscribe from a Promise)
return () => {};
},
@@ -613,21 +613,15 @@ export default {
context.report({
node: declaredDependencyNode,
message:
`The ${
declaredDependencyNode.raw
} literal is not a valid dependency ` +
`The ${declaredDependencyNode.raw} literal is not a valid dependency ` +
`because it never changes. ` +
`Did you mean to include ${
declaredDependencyNode.value
} in the array instead?`,
`Did you mean to include ${declaredDependencyNode.value} in the array instead?`,
});
} else {
context.report({
node: declaredDependencyNode,
message:
`The ${
declaredDependencyNode.raw
} literal is not a valid dependency ` +
`The ${declaredDependencyNode.raw} literal is not a valid dependency ` +
'because it never changes. You can safely remove it.',
});
}
@@ -697,22 +691,16 @@ export default {
bareFunctions.forEach(({fn, suggestUseCallback}) => {
let message =
`The '${fn.name.name}' function makes the dependencies of ` +
`${reactiveHookName} Hook (at line ${
declaredDependenciesNode.loc.start.line
}) ` +
`${reactiveHookName} Hook (at line ${declaredDependenciesNode.loc.start.line}) ` +
`change on every render.`;
if (suggestUseCallback) {
message +=
` To fix this, ` +
`wrap the '${
fn.name.name
}' definition into its own useCallback() Hook.`;
`wrap the '${fn.name.name}' definition into its own useCallback() Hook.`;
} else {
message +=
` Move it inside the ${reactiveHookName} callback. ` +
`Alternatively, wrap the '${
fn.name.name
}' definition into its own useCallback() Hook.`;
`Alternatively, wrap the '${fn.name.name}' definition into its own useCallback() Hook.`;
}
// TODO: What if the function needs to change on every render anyway?
// Should we suggest removing effect deps as an appropriate fix too?
@@ -40,15 +40,15 @@ if (__DEV__) {
const listenersLen = listenersIsArr
? dispatchListeners.length
: dispatchListeners
? 1
: 0;
? 1
: 0;

const instancesIsArr = Array.isArray(dispatchInstances);
const instancesLen = instancesIsArr
? dispatchInstances.length
: dispatchInstances
? 1
: 0;
? 1
: 0;

if (instancesIsArr !== listenersIsArr || instancesLen !== listenersLen) {
console.error('EventPluginUtils: Invalid `event`.');

0 comments on commit b979db4

Please sign in to comment.
You can’t perform that action at this time.