Category "reactjs"

Why componentDidMount gets called multiple times in react.js & redux?

I read componentDidMount gets called only once for initial rendering but I'm seeing it's getting rendered multiple times. It seems I created a recursive loop.

React function based component wont return component inside nested map function

I am trying to output different components based on the inputType, however the component or anything that goes into the DOM does not render (aka console.logs fi

How to solve async-await function problem while using Axios?

I want to use axios using async await function. But when I use async await function then I get an error. useEffect(async() => { await axios .get("

React-Idle-Timer: Show countdown of remaining time

Is it possible to show a second-by-second countdown of remaining time in React-Idle-Timer? This example they have on the site only shows it in certain scenarios

Reactjs : Failed to load module script: WIth MIME type "application/octet-stream" for sharepoint webpart

I'm using reactjs project for use as a webpart for the sharepoint project. But when i deploy the build project. It give me below error. Failed to load module s

How to render live session of website and also interact with it

So there are a few tools to record and view live sessions of users on your website using js sdks's like: logrocket, hotjar, https://github.com/rrweb-io/rrweb ht

Yup returns always an error even if all fields are valid

Yup is returning always one error in the array even though all fields are valid. The validation is working fine, is checking each field and showing the errors c

Amplify UI is not working proper in React js

I am using AWS amplify for user authentication. UI is not what expected but no problem with functionality. Amplify dependencies "dependencies": { "@aws-amp

Error: useLocation() may be used only in the context of a <Router> component

I have installed react-router-domV6-beta. By following the example from a website I am able to use the new option useRoutes I have setup page routes and returni

How to tell if a user is logged in with http only cookies and JWT in react (client-side)

So I'm trying to follow the security best practices and I'm sending my JWT token over my React app in a only-secure http-only cookie. This works fine for requ

React native communication between React native and android with custom object

I have a react native component that communicates with Android like this - My React Native code- const myModule = NativeModules.MyProcessor; myModule.proces

google picker is not woking in react

react-google-drive-picker react-google-picker methods from both package are expired. response when try to authenticate : { error: "idpiframe_initialization_f

ReactJS + Material-UI: How to alternate colors between Material-UI <Table/>'s <TableRow/>?

I currently have a Material-UI's <Table/> ( http://www.material-ui.com/#/components/table ), and would like each row to switch off between color blue and

Storybook throws an error when I want to install it with Next

Storybook throws this error when I am trying to install with a Next.js app which already exists: • Detecting project type. ✓ • Adding Storyb

The value of "offset" is out of range. It must be >= 0 && <= 17825792

You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection: RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out

How to get Custom Field data on WPGraphQL

How to get Custom Field data on WPGraphQL I add a custom field for upload featured image for category. Now I want to get this value on WPGraphQL Query.

React Material UI show progress in Table while waiting on data

I know it is possible to show Circular progress over the as-yet-to-be-populated table. How do you do it? As it stands right now the table says No records to d

./src/App.js Attempted import error: 'Switch' is not exported from 'react-router-dom'

I can't figure it out why doesn't work. I have uninstalled the react-router-dom package and reinstalled it, but I always have the same error. The error I'm gett

React does not recognize the `initialValue` prop on a DOM element

Warning: React does not recognize the `initialValue` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as

ReactJS: How to determine if the application is being viewed on mobile or desktop browser

In ReactJS, is there a way to determine if the website is being viewed on mobile or desktop? Because, depending on which device I would like to render different