Options
All
  • Public
  • Public/Protected
  • All
Menu

EF React Render Component

A function to render components that can be inserted into another component at specific places.

import * as React from 'react';
import { View } from 'react-native';
import renderComponent, { Component } from '@ef-carbon/react-render-component';

interface IProps {
  Component: Component;
  OptionalComponent?: Component;
}

class Example extends React.PureComponent<IProps> {
  render(): React.ReactNode {
    return (
      <View>
        {renderComponent(this.props.Component)}
        {renderComponent(this.props.OptionalComponent)}
      </View>
    );
  }
}