import React from 'react'; import { ScrollView, StyleSheet, View } from 'react-native'; import HeadingText from '../components/HeadingText'; import MonoText from '../components/MonoText'; // Custom JSON replacer that can stringify functions. const customJsonReplacer = (_: string, value: any) => { return typeof value === 'function' ? value.toString().replace(/\s+/g, ' ') : value; }; export default class ExpoModulesScreen extends React.PureComponent { render() { const modules = { ...global.expo?.modules }; const moduleNames = Object.keys(modules); return ( Host object is installed {`'ExpoModules' in global => ${'ExpoModules' in global}`} Available Expo modules {`Object.keys(global.expo.modules) => [\n ${moduleNames.join(',\n ')}\n]`} {moduleNames.map((moduleName) => { return ( Module: {moduleName} {JSON.stringify(modules[moduleName], customJsonReplacer, 2)} ); })} ); } } const styles = StyleSheet.create({ scrollView: { paddingHorizontal: 10, }, });