score:1
actually an even better type is react.reactnode, that is:
type reactnode = reactchild | reactfragment | reactportal | boolean | null | undefined;
(react.reactelement is part of reactchild).
basically react.reactnode is anything that can be rendered inside jsx:
const testapp: react.functioncomponent<{ elements: array<react.reactnode> }> = props => {
return <>{...props.elements}</>;
};
you should also look at reacts child props. that can be used to compose elements like writing plain html:
<test>
<component1 />
<component1 />
</test>
and your test component would be:
const testapp: react.functioncomponent = props => {
return <>{...props.children}</>;
};
Source: stackoverflow.com
Related Query
- What type is best to pass one React Component to another
- How to pass data from one component to another in React or React-Redux?
- Best practice way to set state from one component to another in React
- React | pass form data from one component to another
- How to pass a prop from one component to another when using react router link
- What is the best way to render a search bar component that takes in a props in another component using react v6
- What is the best way to pass an object's data from one page to another in Ionic?
- how to pass the data from one component to another in react js
- How can I pass props from one component to another using Link and router in react
- How to pass state from one component to another in React js?
- How to pass data from one component to another component in onchange using React js
- React - How can I pass API data from one component to another in a different js file?
- How to pass array as result from one functional component to another in React
- How to pass props onClick from one component to another in React JS
- React couldn't pass a data from one class component into another using Link
- How to pass data from one component to another component/parent in React
- Pass a click Event from one class component to another in React
- pass data in one function to another function inside a React component
- How to pass value from one component to another using onClick in React
- How to pass a const variable from one component to another react
- What is the best way to mount a component when you need a prop from another one
- Pass Object From One Component To Another In React
- How to pass props from one component to another along with props validation - React Hooks
- How to pass json data from one component to another using functions in react
- How do I pass the properties from one component to another in React
- How to pass props from one component to another using optional handling in react hooks
- Pass onClick Value From One Component to Another in React
- Is it possible in react to pass state/props value from one component to another
- How to pass in a react component into another react component to transclude the first component's content?
- React - how to pass state to another component
More Query from same tag
- Material-UI issue with makeStyles
- Query data is received but can not be accessed from GraphQL API
- react card not displaying background
- styled-components 'css' is not defined no-undef
- Pass Props in a Private Route React
- Exporting multiple non functional components in React js
- error saying:- Idling, State changed from up to starting, Stopping all processes with SIGTERM, Process exited with status 143
- React with Typescript | Functional component | Type 'boolean' is not assignable to type 'ReactElement<any, any>'
- Force gif reload in React
- How to change SIZE of bootstrap button according to value in REACT
- Delay update of calculated value until some required state has been set
- reactstrap <UncontrolledDropdown> is rending out of viewport, mr/ml-auto and float-right/left not working
- UseRef only returns me undefined or null
- Can I call react component in a react component
- Add style to specific part of string in an Object prop in ReactJS
- osx create-react-app not installing
- Card game, cannot divide cards to two players
- How to use static js generated throught webpack for react app with es6
- Just update the state of one element on the list in React
- how to add and remove classes in css "ClassName" and React?
- ReactJS: Grouping Array of Objects Based on Title Regex Value
- Once login is successful, how to navigate and display nav links
- Mapbox & D3: How to create proper color scaling?
- React removes spaces
- Redux: Approach to store from reducer
- how we can sort table as costume ordered values?
- ReactJS Jest Puppeteer tests no longer working: ReferenceError: document is not defined
- React Hamburger Menu unfunctional
- Unit Testing with React.js, d3.js and mocha/chai
- Where to store API key in ReactJS?