Invalid attempt to destructure non-iterable instance.
See original GitHub issueI am trying the picker on the expo app, I get this error. I tried the sample Single Date picker code. why is the destructing array but it expects an object.
Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.
const [date, setDate] = (React.useState < Date) | (undefined > undefined);
const [open, setOpen] = React.useState(false);
Changing it to this solves the problem but throws an errow setOpen is not a fucntion when I dismissed the modal
const {date, setDate} = (React.useState < Date) | (undefined > undefined);
const {open, setOpen} = React.useState(false);
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
React JS Error: Invalid attempt to destructure non-iterable ...
Invalid attempt to destructure non-iterable instance says the instance you are trying to iterate is not iterable.
Read more >How I Fixed: TypeError: Invalid attempt to destructure non- ...
This morning I hit upon a really annoying problem whilst trying to write a basic test for a React component.
Read more >Invalid attempt to destructure non-iterable instance-Reactjs
Coding example for the question Uncaught TypeError: Invalid attempt to destructure non-iterable instance-Reactjs.
Read more >invalid attempt to destructure non-iterable instance
The error Invalid attempt to destructure non-iterable instance occurs because of a logic/coding error. The following javascript is used to illustrate the ...
Read more >Invalid attempt to destructure non-iterable instance.
[React] Uncaught TypeError: Invalid attempt to destructure non-iterable instance. ... e.target은 객체이지만 배열의 형태로 구조분해할당 시도했기 때문에 에러가 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I think you’re pasting typescript code in your javascript code. Javascript version looks like
change it from const [userInfo] = useContext(AuthContext) to const {userInfo}= useContext(AuthContext)