Advertisement

TrimwebsolutionsTrimwebsolutions

Problem and Solutions

React: use Children.map to edit props and use functions as Children in the same time in react js ?

By M.K. Verma · 2 May 2022

React: use Children.map to edit props and use functions as Children in the same time in react js ?
<Example>
  {({param1, param2}) => data.map(item=> <ExampleChild> {item.text} {param1} </ExampleChild>)}
</Example>

I want this case and also i want to add props to ExampleChild from Example for example I want to pass a prop index to ExampleChild from Example directly