Category "reactjs"

Reactjs setState asynchronous

I am building a little search engine and got following problem: Everytime I enter a query, the last letter is missing. I figured out, that it has something to

Error: Objects are not valid as a React child (found: object with keys {}). If you meant to render a collection of children, use an array instead. JS

When I am trying to render a component on my user's dashboard I get this error message: Error: Objects are not valid as a React child (found: object with keys

When should I use observer in mobx-react?

I'm doing on migration all of my class component to functional component using mobx-react I wonder all of my components should wrapped by observer or not. I gu

`regeneratorRuntime` is not defined when running Jest test

The title pretty much explains what I'm facing. I'm trying to test a React component that has some state, and I attempt to provide my store to the component in

Uncaught SyntaxError: Unexpected token < with React

I am very much new to React. The following is my first script. But I am getting the following error. Uncaught SyntaxError: Unexpected token < I have e

Validating file size and format with YUP

I have a form using reactjs + formik + yup. I have a multi file upload field. I want to validate the file format and max size using yup. How can I do this?

pass an array of objects to a dropdown (select) using typescript

I'm trying to pass this array of objects options = [ {label:'React', value: 'react'}, {label:'ReactNative', value: 'react-native'},

How to customise React AsyncSelect style

I am trying to customise the style of AsyncSelect component, but seems not able to do it. import AsyncSelect from 'react-select/async'; <AsyncSelect classN

find method is not working in my react application

function ProductScreen(props) { console.log(props.match.params.id); const product = data.products.find((x) => x.id === props.match.params.id); console.l

how to get rid of CORS error with mailchimp API?

How to deal with CORS error with mailchimp API? or what is the problem with this code: This is using mailchimp package: import mailchimp from '@mailchimp/mailch

Not able to get response , showing Operation `users.findOne()` buffering timed out after 10000ms`

I am facing an error while making the POST login request. I had deployed the frontend on Netlify here and the backend on Heroku here. This is my backend logs ht

I created a function in ReactJs but it's not working

Code: import './App.css'; function App() { const firstName = 'Toto'; const lastName = 'Wolff'; const age = 35; const job = 'Principal'; const getFu

Formik Initial Values out of Sync with Redux

This form is used to edit a user profile. It should load with up to date user data for the initial values. To handle this, I've added a redux fetchUser action i

webpack-dev-server Cannot find module 'webpack'

I'm trying to use webpack-dev-server to run a simple program but I'm getting this error: module.js:471 throw err; ^ Error: Cannot find module 'webpack

How to reduce bundle size of first load page in Next.js? [duplicate]

I have a very big bundle size of one of my pages. How can I improve the first loading of the page in Next.js? Pls take a look on screenshot

Getting ReactJS/TypeScript to work with new clean MVC5 project

I've already tried nearly all available tutorials to get a simple MVC5 project to run using TypeScript and ReactJS. Note: I've created the projects from scratch

React Navigation: Is there a way to add another instance of a screen on top of an existing instance of that screen in StackNavigator?

In my React Native app, I have a stack navigator with screens A, B, and C. Screen A displays info on a given user. I want to create a switch user button on scre

rtl in material UI cause ruined my app appearance

I setup my rtl configuration step by step in v5mui. Using: emotion as styled-engine stylis v4 stylis-plugin-rtl v2 Every thing is OK but when using some complic

Module Not Found: Can't resolve 'http2' when importing firebase-admin

Failed to compile ./node_modules/@grpc/grpc-js/build/src/channel.js Module not found: Can't resolve 'http2' in '/Users/Michael/Development/Proje

ReactJS reduce image file size without losing aspect ratio after user selects it in an input

I've been searching everywhere without luck. A simple way to reduce the width of an image picked with a simple <input type="file" /> without it losing it