mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
c289442848
Summary: TurboModuleRegistry export functions and not a TurboModuleRegistry object. See https://github.com/facebook/react-native/blob/main/Libraries/TurboModule/TurboModuleRegistry.js#L37 ## Changelog [GENERAL] [FIXED] - Fix TurboModuleRegistry TS type Pull Request resolved: https://github.com/facebook/react-native/pull/35885 Test Plan: Tested that the import doesn't generate a type error when used correctly. ```ts import * as TurboModuleRegistry from 'react-native/Libraries/TurboModule/TurboModuleRegistry'; export default TurboModuleRegistry.get<Spec>('RNCSafeAreaContext'); ``` Reviewed By: christophpurrer Differential Revision: D42604208 Pulled By: NickGerleman fbshipit-source-id: e6259df24aaf6e37b32cc4b51947294fd655837e
14 lines
386 B
TypeScript
14 lines
386 B
TypeScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
*/
|
|
|
|
import {TurboModule} from './RCTExport';
|
|
|
|
export function get<T extends TurboModule>(name: string): T | null;
|
|
export function getEnforcing<T extends TurboModule>(name: string): T;
|