sudheerj / reactjs-interview-questions

List of top 500 ReactJS Interview Questions & Answers....Coding exercise questions are coming soon!!
38.89k stars 9.24k forks source link

Can `key` have other types? #237

Closed alamenai closed 1 year ago

alamenai commented 1 year ago

Question 19

A key is a special string attribute.

I am just confused if the key has only the string type or it can has other types ( number ).

sudheerj commented 1 year ago

Key can accept string or number but React will convert it to string type inside. I will update the answer to avoid the confusion.