Category "reactjs"

React, Emmet, Visual Studio Code, and CSS-Modules

Is there a way to configure emmet in visual studio code to use React's CSS modules? When I type... div.container and hit tab, it becomes <div className="con

TypeScript: Interface cannot simultaneously extends two types

I'm writing a React app using TypeScript. I use material-ui for my components. I'm writing a custom wrapper for material-ui's Button component. It looks like th

Set acitve classname to multiple items in react js (map)

I need to set the active classname to multiple onclick items inside a .map I have implemented by it only keeps track of current click active index I need the li

" Objects are not valid as a React child (found: object with keys {})."

class Home extends PureComponent { render() { const { proList } = this.props; return ( <HomeWrap> <B

Select all and Select None buttons in Autocomplete Material UI React

I want to implement two buttons Select All and Select None inside Autocomplete React Material UI along with checkbox for each option.When Select All button is c

Password matching validation using the Joi schema in React not working

I want to create a password change form in React. Here is the code of my component : import React, { Component } from "react"; import Joi from "joi-browser"; im

Is there a way to update a readonly array of objects

I do have two arrays arr1 = [1,2,3,4] //readonly array arr2 = [1,2,3,4,5,6,7] arr1 is the main array and I want to update it with contents from arr2 so that wh

TypeError: history.push is not a function Why this show sometime

I don't understand why this error not come every time sometimes the code working and sometimes not working const dispatch = useDispatch() const userDetails = us

grammar & spell checking in nodejs

How to check spelling mistakes, grammar & punctuation errors, use of greetings & short keywords and total time to complete each single chat session in s

React custom mount hook

I always forget to add empty dependencies array in my useEffect hook in React to run the effect only once. That's why I decided to use a custom hook with a clea

warning after login .how to solve this error?

Cannot update a component (BrowserRouter) while rendering a different component (Login). To locate the bad setState() call inside Login, follow the stack trace

React UseEffect is being calling twice

I have the following code in FC component: I just want to call the Api and Log the info when the component is mounted The console.log is being called twice fo

onChange on TextInput Not Working Inside Formik

Generally <TextInput> allows you to type even when you're just specifying a placeholder. However, when using within the Formik form, I am unable to type a

Image in React component loading on one page but not the other one?

Hi guys very simple question. I have a home page and a room page. The question is why is the logo image in the navbar component loading in the homepage but not

TypeScript optional properties not accepting undefined value

<MyCustomField type={props.type} MyCustomField's type type definition: type?: string; props.type's type definition: type?: string; For some reason, I

NextJS Fast refresh not working as expected

I am building a website with nextjs and Chakra UI. I am using emotion to style my navigation. The code of navigation component is as follows: import Link from "

React i18next not working on Firefox/Microsoft Edge browser?

I am using React i18next library for localization in my application. Everything works fine when using the library on localhost, but when I produce a production

prop passed to child component not updated after async call

I am new to React and building a movie db app. I have defined my async fetch movies api call in API.js and call this in the Home.js components' useEffect and se

Is it is possible to test only one function from component with Jest?

I have react component, for example something like this: const MyComponent = (props) => { const [state, setState] = useState(true); const {data} = useCon

How to override Material UI .MuiContainer-maxWidthLg?

I'm trying to get rid of max-width that present in the theme. This is what I see in Chrome (and if I uncheck it, it does what I need): @media (min-width: 1280p