Questions tagged [react-children]
17 questions
7
votes
2 answers
Is it possible document with jsdoc children or render props used as a function?
I'm trying to create a wrapper component using the react render pattern, but I also want to document the arguments passed through render/children, in order to have, for example, an helpful intellisense.
I tried to define my own component as…

Danielo
- 164
- 1
- 15
5
votes
3 answers
In Reactjs, how do you manipulate the children of a child component from a parent component?
I want to make a highly reusable react component with a unique pattern. Assume this contact list was produced by another team; we can't change the components, and it follows the structure shown below.
…

Raja Jaganathan
- 33,099
- 4
- 30
- 33
2
votes
0 answers
Check if child renders top-level React Fragment
Is there a way to programmatically check if a React Element returns a top-level React.Fragment component? For most use cases, react-is is the recommended way to check this type of behavior, but it does not work in this case. If a function component…

Charles Kornoelje
- 758
- 8
- 13
1
vote
1 answer
When get build not Render my child components in Layout But when npm state It works right
Layout components :
return (
<>
- 11
- 1

Amir esmaeelzadeh
1
vote
0 answers
React: How to pass multiple server components to a client component?
Since React doesn't allow importing Server components inside Client components, one workaround is creating an outer Server component, and inside it rendering the Client component with the other Server component passed to it as a child. That's okay,…

noiseymur
- 761
- 2
- 15
1
vote
1 answer
Getting error "Uncaught Error: Objects are not valid as a React child", but I'm not passing objects as children
I'm attempting to map an array of objects, obtained from an axios.get request, as a set of React component children. Here is the full error I'm receiving:
Uncaught Error: Objects are not valid as a React child (found: [object Promise]). If you meant…

Pleasant Nightmares
- 179
- 3
- 12
1
vote
2 answers
Adding a prop to a specific React element type in any level of the DOM tree
I'm trying to add a "position" prop to the 'Child' components and use it inside the 'Parent' component, So the only purpose of the 'PositionWrapper' is to add one prop and return the new children.
The problem is that when I call props.children…

user3764456
- 23
- 7
1
vote
1 answer
React native child not receiving updated props value
I am new to react and making a little app to learn the library and way of thinking.
But I ran into a problem which has me completely stomped...
I have the root components that contains a list of tasks.
I pass these tasks to a custom component to…

FutureCake
- 2,614
- 3
- 27
- 70
0
votes
0 answers
Error: Objects are not valid as a React child while using useeffect and fetch
I was trying to run this but its showing this error -
Error: Objects are not valid as a React child (found: object with keys {adult, backdrop_path, genre_ids, id, original_language, original_title, overview, popularity, poster_path, release_date,…
0
votes
0 answers
Adding ref to the props.children components
This component takes children and assign ref to each child by recreating element.
It works with HTML elements but it doesn't work with components and It gives me this error when I put a component as its child:
react-dom.development.js:86 Warning:…

ssss
- 1
0
votes
0 answers
How to get children of nested fonctionnal components
Is it possible to access grand children through React.children.map(), if children are components ?
For exemple, a component :
const MyComponent = () => {
return (
Demo
)
}
Used in another component…
Nico
- 1
- 1
0
votes
1 answer
Expose a Custom Hook to Children (children only) in React
I'm not sure the title is correct, so let me try to explain what I'm trying to achieve.
Let's say I have a flow in my application that has 3 steps in it, so I create a component (let's call it Stepper) with 3 child components where each child is a…

Elyasaf755
- 2,239
- 18
- 24
0
votes
1 answer
React - Error while rendering child component with prop passed from parent component
I have a problem while creating my react app. I'm fetching data from CoinGecko API to build a crypto tracking app, but when I pass the data prop from the parent App.js to the child Info.js. When I try to render the page it gives me Info.js:45…

JustLooller
- 13
- 3
0
votes
1 answer
What is the right way to pass array of objects to a form component of react?
I have a data.js file with the following data
const formData = [
{
name: 'username',
type: 'text',
placeholder: 'placeholder',
labelText: 'User Name'
},
{
name: 'password',
type: 'password',
…

jeff
- 910
- 2
- 6
- 25
0
votes
1 answer
function are not valid as a react child
why is this error coming. i don't know what to do. please help me
Warning: Functions are not valid as a React child. This may happen if you return a Component instead of from render. Or maybe you meant to call this function rather than return…

dumino
- 1
- 1