{"ast":null,"code":"\"use strict\";\n\nimport * as React from 'react';\nimport { NavigationBuilderContext } from \"./NavigationBuilderContext.js\";\nimport { useClientLayoutEffect } from \"./useClientLayoutEffect.js\";\nexport function useScheduleUpdate(callback) {\n  var _React$useContext = React.useContext(NavigationBuilderContext),\n    scheduleUpdate = _React$useContext.scheduleUpdate,\n    flushUpdates = _React$useContext.flushUpdates;\n  scheduleUpdate(callback);\n  useClientLayoutEffect(flushUpdates);\n}","map":{"version":3,"names":["React","NavigationBuilderContext","useClientLayoutEffect","useScheduleUpdate","callback","_React$useContext","useContext","scheduleUpdate","flushUpdates"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/@react-navigation/core/src/useScheduleUpdate.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { NavigationBuilderContext } from './NavigationBuilderContext';\nimport { useClientLayoutEffect } from './useClientLayoutEffect';\n\n/**\n * When screen config changes, we want to update the navigator in the same update phase.\n * However, navigation state is in the root component and React won't let us update it from a child.\n * This is a workaround for that, the scheduled update is stored in the ref without actually calling setState.\n * It lets all subsequent updates access the latest state so it stays correct.\n * Then we call setState during after the component updates.\n */\nexport function useScheduleUpdate(callback: () => void) {\n  const { scheduleUpdate, flushUpdates } = React.useContext(\n    NavigationBuilderContext\n  );\n\n  // FIXME: This is potentially unsafe\n  // However, since we are using sync store, it might be fine\n  scheduleUpdate(callback);\n\n  useClientLayoutEffect(flushUpdates);\n}\n"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,wBAAwB;AACjC,SAASC,qBAAqB;AAS9B,OAAO,SAASC,iBAAiBA,CAACC,QAAoB,EAAE;EACtD,IAAAC,iBAAA,GAAyCL,KAAK,CAACM,UAAU,CACvDL,wBACF,CAAC;IAFOM,cAAc,GAAAF,iBAAA,CAAdE,cAAc;IAAEC,YAAA,GAAAH,iBAAA,CAAAG,YAAA;EAMxBD,cAAc,CAACH,QAAQ,CAAC;EAExBF,qBAAqB,CAACM,YAAY,CAAC;AACrC","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}