{"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  const {\n    scheduleUpdate,\n    flushUpdates\n  } = React.useContext(NavigationBuilderContext);\n  scheduleUpdate(callback);\n  useClientLayoutEffect(flushUpdates);\n}","map":{"version":3,"names":["React","NavigationBuilderContext","useClientLayoutEffect","useScheduleUpdate","callback","scheduleUpdate","flushUpdates","useContext"],"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,MAAM;IAAEC,cAAc;IAAEC;EAAa,CAAC,GAAGN,KAAK,CAACO,UAAU,CACvDN,wBACF,CAAC;EAIDI,cAAc,CAACD,QAAQ,CAAC;EAExBF,qBAAqB,CAACI,YAAY,CAAC;AACrC","ignoreList":[]},"metadata":{"hasCjsExports":false},"sourceType":"module","externalDependencies":[]}