Category "reactjs"

How to make autocomplete field of material UI required?

I have tried a couple of ways in order to make the material UI's autocomplete field of type required but I am not getting the behavior that I wanted. I had enca

Focus Picker component on react native

I have a Picker component as a part of a form on react native. I want to focus the picker when the user click on the submit button on the keyboard just as I can

React Native render error Value is undefined expected a object

So I dont know why I am getting this weird error and I am unable to find any solution for it so plz help with me Error Code import React, { useRef, useState

How can solve this error "Uncaught TypeError: inputArgs[0].match is not a function"

When login first then immediatly show:- "Uncaught TypeError: inputArgs[0].match is not a function" this error . I'm using react-firebase-auth hook. when I try

Apollo Client empty context (sometimes?)

So I've run into this weird issue i cannot resolve. My client code was working fine until today. Without any updates to the packages or to the code related to a

eCSSTractor for VSCode plugin not worked with className

eCSSTractor does not work with react jsx syntax. doesn't translate "className" elements in css. In setting.JSON written rule - "ecsstractor_port.attributes"

react useEffect comparing objects

I am using react useEffect hooks and checking if an object has changed and only then run the hook again. My code looks like this. const useExample = (apiOptio

How can I use React Material UI's transition components to animate adding an item to a list?

I have this class. class Demo extends React.Component { constructor(props) { super(props); this.state = { items: [] }; this.add = this

Is there a React shorthand for passing props?

I am tired of doing this all the time: <Elem x={x} y={y} z={z} /> <Elem x={this.props.x} y={this.props.y} z={this.props.z} /> Is there a way I can

React: Module not found: Can't resolve 'xmlhttprequest'

I'm getting an error when trying to build my React project: ./node_modules/ethers/utils/web.js Module not found: Can't resolve 'xmlhttprequest' in '/mnt/c/User

I get webpack not installed, but webpack --version finds webpack

I am following this tutorial to create a React project with webpack. Everything went smooth until step 4 webpack --config webpack.config.js, where I get this er

ReactJS multiple video autoplay on iOS

I'm developing a website with iOS friendly. I have some experiences of making video auto play on iOS. To make able to autoplay on iOS, we must follow these rul

Material UI Menu not closing after clicking a menu item

This is code straight from MUI menu - customized menu.. I didn't want to put my code because there are some built in functions that make it more confusing. In

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'},