I have an app with a number of components. One of the components I need be to able to pass different variations of another two components into, based on a layout. I believe it can be passed in like a data attribute, but I'm unsure of the exact syntax to push the other components in.
Given two components <List />
and <Box />
which are currently in another component being imported into my main App.js
file as such:
export const CallOut = () => {
return(
<div style={styles.sectionInner}>
<List />
<BoxRight/>
</div>
)
};
where <CallOut />
is being imported into App.js
, I'd like to pass those two components into the <CallOut />
component.
What is the correct syntax to pass those two in and have them placed in the same spot they're currently in within the CallOut
component?
I believe it should be something similar to
<CallOut param={List} param={BoxRight} />
but I know this isn't right.