Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 503 Bytes

File metadata and controls

21 lines (13 loc) · 503 Bytes

react-native-app-helpers/unwrapRenderedFunctionComponent

Unwraps a rendered JSX element which itself renders to a JSX element.

Usage

import { unwrapRenderedFunctionComponent } from "react-native-app-helpers";

const Component: React.FunctionComponent = ({ children }) => (
  <Text>{children}</Text>
);

const rendered = <Component>Test Content</Component>;

const a = unwrapRenderedFunctionComponent(rendered);

const b = <Text>Test Content</Text>;

// a and b are equivalent here.