React tsx

const AppContainer: React.SFC<IAppContainerProps & IAppContainerState & IAppContainerDispatch> = props => (
    <IntlProvider locale={props.locale} defaultLocale="en-US" messages={props.localeMessages}>
        <App
            isAuthenticated={props.isAuthenticated}
            isLoaded={props.isLoaded}
            isCollapsed={props.isCollapsed}
            switchWindow={props.switchWindow}
        />
    </IntlProvider>
);

what does this syntax mean and where does props pass in

?
Mar.04,2021

this is a functional component that TypeScript writes, SFC (Stateless Functional Components) for stateless.
your writing is one of two ways React defines components.

< IAppContainerProps & IAppContainerState & IAppContainerDispatch >
indicates type checking of typeScript. Used to enforce type constraints.
other places should declare code similar to the following:

interface IAppContainerProps {
    name: string
}
interface IAppContainerState {
    name: string
}
interface IAppContainerDispatch {
    name: string
}

props is the

brought in when referencing AppContainer this component.

identifies AppContainer as React.SFC < IAppContainerProps & IAppContainerState & IAppContainerDispatch >
this is a high-order component, and props is passed through function arguments


props is generally provided to the parent component.
is the one that is passed in when the AppContainer component is called.

Menu