Skip to content
Advertisement

Tag: react-component

I am trying to draw circles and add popup on a map, but i keep getting errors. Cannot read properties of undefined (reading ‘lng’)

This piece of code is from my App.js I am using this as the default location of the map once the app opens const [mapCenter, setMapCenter] = useState({lat: 34.80746, lng: -40.4796}); I use this to update the location of the map, as selected from the dropdown menu, I am getting the lat and lng from data pulled from an endpoint

updating a useState to the value that it’s already holding inside of a custom React hook causes infinite re-render

The above will cause an infinite re-render. I had to solve by doing this: This is not the behavior inside of React components. Inside a component, if I set a useState to true when it is already true, then it will not cause re-render. Can someone confirm this behavior and explain why it causes infinite re-render inside of a Hook

Uncaught DOMException: Failed to execute ‘createElement’ on ‘Document’: The tag name provided

i had created card component and i called in my ProductPage.js after that i am getting error like Uncaught DOMException: Failed to execute ‘createElement’ on ‘Document’: The tag name provided (‘/static/media/Card.c3b0a67ff849f2bda062.JS’) is not a valid name. initially it was div and i change to card after that i am getting above error if changed div then it is working fine

Advertisement