Category "reactjs"

Submitting form from parent component

I would like to create a form where the submit button is located in the header. I'm currently using react-hook-forms but am having difficulties being able to su

React app returning 500 Internal Server Error

I have a react app, created using create-react-app. After I run npm run build, and deploy the app as a static site, everything works except when I refresh the

Loading micro frontend root App component's CSS in singleSpaReact on mounting to the host application

colleagues! Need a piece of advice! Micro frontend in singleSpaReact does not load root's component CSS at the mounting, but only page CSS according routing nav

How to get loading progress in React.lazy and Suspense

I'm using lazy to split my routes and I wanna know if there is any way I can get the loading progress in lazy and suspense. Currently I'm using it like this.

Can't save state in React while POST API request

I have handleSubmit function that send two POST request, one for img upload and one for other information. I want to take the response from the img upload reque

How to add multiple components into one story using Storybook?

I just started using storybook, and I need your help. I've four components for the different icons, and I want to create one story for all of them instead of cr

How can I edit compressed JS files

I have had a developer create a website or app in React. This is already on a webserver and does what it should do. Now I want to develop the frontend myself, w

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