Unable to read properties in nested array table
KiaClouth opened this issue · comments
Describe the bug
I try to display some data in jsx but nothing appears
Your minimal, reproducible example
https://tanstack.com/form/latest/docs/framework/react/examples/array
Steps to reproduce
Insert {field.state.value["name"] + "ss"}
at line 36
Expected behavior
show some text
How often does this bug happen?
Every time
Screenshots or Videos
Platform
- OS: windows
- Browser: chrome
-framerwork: nextJs 14
TanStack Form adapter
react-form
TanStack Form version
v 0.19.2
TypeScript version
v5.1.6
Additional context
I have a more complex form locally, but the problem should be the same as mentioned here. I am not a professional front-end development engineer, I hope it is not my own problem
You're trying to access the wrong thing here. field.state.value
is an array of objects. To access a value, you'll need to replace your interpolated JSX with:
{field.state.value[i].name}
Thank you very much, and sorry for wasting your time. I didn't realize this was the problem at all.hhh