Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to put dynamic data to items prop #62

Open
Rohit-Jain24 opened this issue Feb 3, 2021 · 3 comments
Open

how to put dynamic data to items prop #62

Rohit-Jain24 opened this issue Feb 3, 2021 · 3 comments

Comments

@Rohit-Jain24
Copy link

how to put dynamic data to items prop without using {"id":1,"name":React} as key

I got different JSON as it is from Backed Response it doesnt have key as id and name as items are not visible in the list

@jhon-hst
Copy link

jhon-hst commented Mar 3, 2021

The same question

@JustineAyroor
Copy link

JustineAyroor commented Apr 7, 2021

you can use map function
let taskType = this.props.data.tasks.taskType.map((name,index)=>{
return ({name: ${name},id: ${index}})
})
;

@Utkarshkr1710
Copy link

Utkarshkr1710 commented Jun 28, 2021

where we should use this in index file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants