You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
579 B

import * as React from 'react';
const contexts = '__react_navigation__elements_contexts';
// We use a global variable to keep our contexts so that we can reuse same contexts across packages
global[contexts] = global[contexts] ?? new Map();
export default function getNamedContext(name, initialValue) {
let context = global[contexts].get(name);
if (context) {
return context;
}
context = /*#__PURE__*/React.createContext(initialValue);
context.displayName = name;
global[contexts].set(name, context);
return context;
}
//# sourceMappingURL=getNamedContext.js.map