skip to Main Content

React – open new tab once – Reactjs

If a component is rendered. I want to open a new tab. (window.open(url, "_blank")?.focus();) But (during development) this tab is opened twice because of the React.StrictMode. How can I prevent this from being called multiple times without disabling the StrictMode?…

VIEW QUESTION

Uncaught SyntaxError: Export 'import_react3' is not defined in module (at chunk-…) : import_react3 as import_react, – Reactjs

I have created my react js application using vite. and i am using npm. I installed material ui and my package.json file has these packages: "dependencies": { "@emotion/react": "^11.10.6", "@emotion/styled": "^11.10.6", "@mui/material": "^5.11.15", "@mui/styled-engine-sc": "^5.11.11", "@mui/x-data-grid": "^6.0.3", when i run…

VIEW QUESTION

In Reactjs Getting an error .map() is not a function – Javascript

when i try to fetch response from api i got map is not a function error .but i declared state as array. Here's the code: function VendorListScreen(){ const [vendorsList,setVendorsList]=useState([]); const getVendors =()=>{ axios.get('http://127.0.0.1:8000/api/vendors/').then((res)=>{ setVendorsList(res.data) }) } <h1>Vendor</h1> <button onClick={getVendors}>get</button> {vendorsList.map(vendor=>{…

VIEW QUESTION
Back To Top
Search