Complete the code to import the React Native bridge module.
import [1] from 'react-native';
The NativeModules object is used to access native bridge modules in React Native.
Complete the code to create a TurboModule in the new React Native architecture.
const MyModule = require[1]('MyTurboModule');
In the new architecture, TurboModuleRegistry.getEnforcing is used to get a TurboModule with type safety.
Fix the error in the code to correctly send an event from native to JavaScript using the new architecture.
this.[1].emit('eventName', { data: 'value' });
The NativeEventEmitter is used to send events from native code to JavaScript in React Native.
Fill both blanks to complete the code that defines a React Native Fabric component.
import { [1] } from 'react-native'; const MyComponent = [2](() => { return null; });
requireNativeComponent imports the native UI component, and createFabricComponent wraps it for the Fabric renderer.
Fill all three blanks to complete the code that sets up a TurboModule interface in TypeScript.
export interface MyModuleSpec {
[1](): Promise<string>;
}
export default TurboModuleRegistry.[2]<MyModuleSpec>('MyModule');
const myModule = [3];The interface method is named fetchData. The TurboModule is accessed with getEnforcing. The constant myModule stores the module instance.