Complete the code to enable Flipper in a React Native app.
if (__DEV__) { require('react-native-flipper').[1](); }
The connect() function from react-native-flipper starts the connection to Flipper in development mode.
Complete the code to add Flipper plugin for React DevTools.
import ReactDevTools from 'react-devtools-core'; Flipper.addPlugin(new ReactDevTools.[1]());
The Client class from react-devtools-core is used to create a new React DevTools plugin instance for Flipper.
Fix the error in the Flipper setup to correctly enable network plugin.
import { NetworkPlugin } from 'react-native-flipper'; const network = new NetworkPlugin(); Flipper.[1](network);
The correct method to add a plugin instance to Flipper is addPlugin().
Fill both blanks to create a Flipper plugin that logs messages.
class LoggerPlugin extends Flipper.[1] { constructor() { super('[2]'); } }
Flipper plugins extend the Plugin class. The plugin name can be any string, here 'Logger'.
Fill all three blanks to create a Flipper React Native plugin with lifecycle methods.
class MyPlugin extends Flipper.[1] { onConnect() { console.log('[2] connected'); } onDisconnect() { console.log('[3] disconnected'); } }
The plugin class extends Plugin. The plugin name used in logs is 'MyPlugin'.