1import React, { PropsWithChildren, useEffect } from 'react';
2
3import { B } from '~/components/base/paragraph';
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    <details>
18      <summary>
19        <B>Are you using this library in a bare React Native app?</B>
20      </summary>
21      {children}
22    </details>
23  );
24};
25