Category "reactjs"

Role based react-router

What is the best way to conditionally render routes in react-router based on user role. I have a case where not all roles have permission to view certain routes

Uncaught Error: Invalid hook call. ReactJs

I am relatively new to react and I am trying to render a leaflet map on my site but I am currently getting an Invalid Hook call error. Any information would be

Module not found: Error: Can't resolve '@mui/icons-material/SearchOutlined'

I have installed both the packages already the icon and the core but still m getting this error, why?? import React from 'react' import './Nav.css'; import

I want to add web3 package to react project - BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default

I add web3 package to my react project and start. yarn add web3 yarn start But it causes following errors: ... BREAKING CHANGE: webpack < 5 used to includ

React Native Metro bundler resolver issue with json (None of these files exist)

I have monorepo with React code and React Native code. react - common - - file.json ... react-native - App.js In App.js I tried to import json file from react/

Is it possible to set top border on ChartJS Doughnut Gauge chart

Target Doughnut gauge with green top border: Example Doughnut gauge: https://codesandbox.io/s/jlonjk9zv5 The question: Is it possible to implement abovemention

React-router stops working when error boundary catches an error in route

The codepen linked to below, uses react-router and an error boundary to catch errors within each route. If you click on "Shop", the error is caught as expected

Array.prototype.map() expects a return value from arrow function array-callback-return

Don't really know why it is saying this but this is the code I believe it is talking about setUpdate(text, key) { const items = this.state.items; items.map(

React - react-final-form validation

I have a question regarding react-final form error message when using record-level validation. I have the following field present within FormFilterFields compon

How to check if user has a specific token by querying NFTBalances?

I am trying to check if a user has a specific token, in my case token_id should be "87". How can I check that using NFTBalances? I wrote the code below but it i

Vite Server is running but not working on localhost

Vite + Reactjs server is running but I am getting "This localhost page can’t be found No webpage was found for the web address: https://localhost:4200/" o

How to create React App including Web3 using create-react-app? I am getting Module not found Error. BREAKING CHANGE: webpack < 5 used

I am new to Web3 and I am trying to create a react app integrated with web3. Below are the steps I followed in Ubuntu. create-react-app app_name cd app_

I am facing an error net::ERR_ABORTED 401 (Unauthorized)

In my componentDidMount function I have a problem. I'm facing error 401 in my Reactjs site, my username and password are correct. componentDidMount() { co

react-select and typescript: Type 'string' is not assignable to type 'ValueType<OptionTypeBase>'

I am trying to create an example component that uses react-select with typescript. For this, I created a functional component and added the default example fro

Protected Route by checking JWT saved in user's cookie

I just finished implementing Google social authentication in my NextJS + DjangoRest project following this blog post. I am trying to figure out how to make prot

Paste test in cypress in reactjs project

Any ideas how to simulate Paste action in Cypress in a bundle with React? My test should check value right after paste action. I found few solutions based o

is there a way to implement react scroll along with react router dom?

I have a navbar with links that scroll to sections of page using react-scroll. i also have several pages and im using react-router-dom for navigating between pa

Netlify page not found 404 after clicking a button

I'm new to here, just have a question and want to solve it. I have deployed my app on netlify, everything works fine at localhost, but when I tested it on netl

How to stop infinite refresh in react webpack app?

When I change the TS file, Webpack doesn't stop refreshing the page. Console says: @ebpack 5.66.0 compiled successfully I've googled this and tried different pl

Why I can't install React and uninstall create-react-app in my system?

I have tried so many ways. But I can't find any solution. The problem is I can't install ReactJS in my system. Here is the message I get when complete my instal