1import React, { PropsWithChildren, useEffect } from 'react'; 2 3import { Collapsible } from '~/ui/components/Collapsible'; 4 5type Props = PropsWithChildren<object>; 6 7export const ConfigReactNative = ({ children }: Props) => { 8 useEffect(() => { 9 if (typeof children === 'string') { 10 throw new Error( 11 `Content inside 'ConfigReactNative' needs to be surrounded by new lines to be parsed as markdown.\n\nMake sure there is a blank new line before and after this content: '${children}'` 12 ); 13 } 14 }, [children]); 15 16 return ( 17 <Collapsible summary="Are you using this library in a bare React Native app?"> 18 {children} 19 </Collapsible> 20 ); 21}; 22