{"record":{"id":"6e2147d4fcc208ed","repo":"chenglou/react-motion","slug":"reorderkeys-has-been-removed-since-it-is-no-lon","errorCode":null,"errorMessage":"`reorderKeys` has been removed, since it is no longer needed for TransitionMotion's new styles array API.","messagePattern":"`reorderKeys` has been removed, since it is no longer needed for TransitionMotion's new styles array API\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/reorderKeys.js","lineNumber":8,"sourceCode":"/* @flow */\n\nlet hasWarned = false;\nexport default function reorderKeys() {\n  if (process.env.NODE_ENV === 'development') {\n    if (!hasWarned) {\n      hasWarned = true;\n      console.error(\n        \"`reorderKeys` has been removed, since it is no longer needed for TransitionMotion's new styles array API.\",\n      );\n    }\n  }\n}\n","sourceCodeStart":1,"sourceCodeEnd":14,"githubUrl":"https://github.com/chenglou/react-motion/blob/9e3ce95bacaa9a1b259f969870a21c727232cc68/src/reorderKeys.js#L1-L14","documentation":"`reorderKeys` was a helper exported by react-motion in v0.3 that callers needed to reorder interpolated key objects for TransitionMotion. In react-motion v0.4 TransitionMotion switched to a `styles` array API, making reordering unnecessary, so the export was removed. Calling it now triggers this one-time dev-mode console.error stub instead of a real function.","triggerScenarios":"Calling the `reorderKeys` function imported from react-motion (e.g. `import reorderKeys from 'react-motion/lib/reorderKeys'`) in development mode. The console.error fires once per page load (guarded by `hasWarned`) and only when NODE_ENV is 'development'.","commonSituations":"Upgrading react-motion from <=0.3 to >=0.4 while keeping old code that imported reorderKeys, copying deprecated TransitionMotion examples/tutorials from before the styles-array API change, or deep-importing internal lib files ('react-motion/lib/reorderKeys') that still ship the warning stub.","solutions":["Remove the `reorderKeys` import and all calls to it from your code.","Migrate TransitionMotion usage from the old single-object/defaultStyles API to the new `styles` array API (pass `styles={[{key, data, style}]}`), which eliminates the need for key reordering.","Update any deep imports like `react-motion/lib/reorderKeys` and consult the react-motion 0.4 migration guide / changelog.","If the warning comes from a dependency, upgrade that dependency to a version compatible with react-motion >=0.4."],"exampleFix":"// before (react-motion <=0.3)\nimport reorderKeys from 'react-motion/lib/reorderKeys';\nconst ordered = reorderKeys(interpolated, keys);\n\n// after (react-motion >=0.4 styles array API)\n<TransitionMotion styles={configs.map(c => ({ key: c.key, data: c.data, style: c.style }))}>\n  {interpolatedStyles => ...}\n</TransitionMotion>","handlingStrategy":"validation","validationCode":"import reorderKeys from 'react-motion/lib/reorderKeys';\nif (typeof reorderKeys === 'function') {\n  console.warn('react-motion: reorderKeys exists but is deprecated; migrate to the styles array API.');\n}","typeGuard":"function isReorderKeysRemoved(fn) {\n  return typeof fn === 'undefined' || fn.toString().includes('has been removed');\n}","tryCatchPattern":"// The stub only logs via console.error; it does not throw, so wrap the call and silence the log once.\ntry {\n  reorderKeys();\n} catch (e) {\n  console.warn('reorderKeys is unavailable:', e.message);\n}","preventionTips":["Do not deep-import internal files (react-motion/lib/*); import only from the package root.","Read the react-motion changelog when upgrading major/minor versions.","Replace reorderKeys usage with the TransitionMotion styles array API during migration.","Pin your react-motion version and update dependencies deliberately, grepping for removed exports before upgrading.","Grep your codebase for 'reorderKeys' as part of the upgrade checklist."],"tags":["react-motion","deprecated-api","migration","dev-warning"],"backgroundTag":"deprecated-api-removed","analyzedSha":"9e3ce95bacaa9a1b259f969870a21c727232cc68","analyzedAt":"2026-09-01T10:14:25.530Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}