This always works for me but for some reason, it does not work in my react-bootstrap component and this is confusing, rest parameter {classes, ...props} cause the code to throw an error and don't know why??
When i tried to reproduce the error in codesandbox everything worked ok , but the error still in my machine even after creating many new projects and removing all packages that can affect code till i reached to the point that i have created a very basic project i uploaded it on github here
Just importing the ReusableDropdown component from dropdown.js file produced a type error and react says that the error happens in the component itself not inside the parent component:
./src/reusable/dropdown.js
TypeError: Cannot read property 'forEach' of undefined
This should work and i am sure the error has no relation to the syntax, that's a kind of weird error!!
PS: You need to install react-bootstrap and bootstrap as dependencies to be able to reproduce the error
Cannot read property 'forEach' of undefinedcould be related to an object, since objects don't haveforEach... unless there's some transpiling going on