react-universal-container
Version:
Allows React and React-Native front end Components to use the same properties, and gives you the ability to write your important code once.
27 lines (26 loc) • 1.3 kB
TypeScript
/// <reference types="react" />
import * as React from "react";
export interface UniversalContainerProps<TChildComponentProps> {
component: React.ComponentClass<TChildComponentProps> | React.SFC<TChildComponentProps>;
}
/**
* UniversalContainer is used as a generic, cross-platform component to
* "sandwich" between two platform-specific components. It takes a specific
* prop named `component` which is the class of the child component it will
* create. It passes all of its other props to that subcomponent. Any
* complex state mapping logic can then be included in your cross platform
* container component.
*
* E.g
* ScreenComponentReactNative [Native Platform Specific]
* └─┬ UniversalContainer<ViewComponentProps> [Cross Platform]
* └── ViewComponentReactNative<ViewComponentProps> [Native Platform Specific]
* or
* ScreenComponentReact [Web Platform Specific]
* └─┬ UniversalContainer<ViewComponentProps> [Cross Platform]
* └── ViewComponentReact<ViewComponentProps> [Web Platform Specific]
*/
export declare class UniversalContainer<TChildComponentProps, TChildComponentState> extends React.Component<UniversalContainerProps<TChildComponentProps> & TChildComponentProps, TChildComponentState> {
props: any;
render(): JSX.Element;
}