select
select copied to clipboard
fix: null initialValue breaks when labelInValue is set
fix: null initialValue breaks when labelInValue is set
This pull request is being automatically deployed with Vercel (learn more). To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/react-component/select/boe295pmg ✅ Preview: https://select-git-fork-tli4-fix-labelinvalue-break.react-component.vercel.app
what if value = ''
what if
value = ''
this is executed only if labelInValue is set. It tries to spread key and value out of the array item, which is an object(or null in this case). If you pass a value equals to empty string or any other string, It will panic.
Actually this is a typical error when you try set a string value for a labelInValue Select
. We can also give better hint on why this breaks the code.