Category "reactjs"

Material UI Button - Align Ellipsis Label with Start Icon

I'm trying to set a start icon on a button and also the text label could be very long to use ellipsis at the end. I can't figure it out a way to align the start

Failed prop type: Invalid prop `errors` of type `string` supplied to `CreateProfile`, expected `object`

I am trying to create a profile for a user on login, after submitting the form I am getting the error as invalid props errors. As both my client and serv

How to update react state without re-rendering component?

I am building a gallery app where I need to create multiple HTTP requests to pull gallery entries(images & videos). As gallery will be auto scrolling entr

event.target.value as a number?

const [data, Setdata] = useState<number[] >([]); const [inputData, SetinputData] = useState<number>(0); const [canAdd, SetcanAdd] = useState<boo

useRef TypeScript - not assignable to type LegacyRef<HTMLDivElement>

I am trying to use useRef with TypeScript but am having some trouble. With my RefObject (I assume) I need to access current. (ie node.current) I have tried the

peer.on('calll') is never being called

Peer js is not working I am just creating peerjs video streaming application in NodeJs and ReactJs The below code is working fine, i am able to create new peer

In React with Formik how can I build a search bar that will detect input value to render the buttons?

New to Formik and React I've built a search component that I'm having issues with the passing of the input value and rendering the buttons based on input length

How to use the default value attribute of a select tag

Now im working on a small task with a select tag like this <select name="selectmedgroup" id="selectmedgroup" value

Using ES6 Map with React and/or Redux

I am looking at using the ES6 Map object to do my hashing for me, instead of creating a custom hashing function. However, it seems to me that it doesn't have mu

What are assertions in JEST?

It's documentation says that while dealing with async code, expect.assertions(x) should be written. What exactly do assertions refer to? Is it a term of plain J

React - Jest - Enzyme: How to mock ref properties

I'm writing test for a component with ref. I'd like to mock the ref element and change some properties but have no idea how to. Any suggestions? // MyComp.jsx

Why remove QA IDs from the code base in production

In a React application that we are developing we use QA IDs for Selenium tests. Is it bad practice to leave them in the code base in production (live)? If so,

NextJS: How to correctly add firebase analytics to NextJS app

I have a react/nextjs app and I have firebase.js as follow: import firebase from 'firebase/app' import 'firebase/auth' import 'firebase/analytics' import 'fireb

I can't install react using npx create-react-app?

I am trying to use npx create-react app but i have errors that is shown below: npm ERR! Unexpected end of Json input while parsing near '...eact-app/-/create-r

override formik.onChange with custom onChange method in reactjs

I'm trying to get the value of a file input so that I can make a custom file input. But when I try to pass the value using onChange prop the value is not passin

display avatar on the last current message in case of subsequent messages

I am working on a chat box where I need to show the messages of users by grouping the messages on a particular date. The grouping has been working fine so far.

How to create an admin route and another private route for registered users with a normal route?

I have used this code as the private route, but I want a another separate route only for admins. How can I change the code? import React from 'react'; import {

Using react-highcharts, trying to update the xAxis categories values, but it doesn't, it keeps the values in my config variable.

As stated above, I can't seem to get the categories to re-render when I am using the react-highchart library. I seem to be able to set the data of the chart val

React unable to import component -- module not found

I just started with React.js and I am unable to import component. I have this structure as followed by this tutorial (YouTube link) : -- src ----| index.html

Prevent re-sort on data change or while row is being edited

On react-table when the table is sorted and data changes, the table can either reset (go to default sort state) or re-sort (by putting the edited row in the cor