Category "reactjs"

I can't seem to pass an array of objects as prop (console logs 1 object, [object object] instead)

I am new to React js and I am trying to pass my data(dummy_data) as props from App.js to PieChart.js so that I can access the data from PieChart.js. dummy_data

How to enable VS code intellisense for absolute path imports in a React app?

So, i recently created a React app and added the absolute imports by updating the jsconfig.json for my project as per the documentation (https://create-react-ap

SessionStorage is Null

First of all I'm saving a user in SessionStorage in React. The problem is that I'm trying to make a filter that validates some data in the user saved in Session

Set maximum form field length in React Admin

Is there some way to set a field in a SimpleForm within React-Admin to limit the number of characters a user can type into that field? Based on the docs, the Re

Changing material UI button text based on a condition

I am using the material UI button for my component and want to change the button text based on a condition that if order amount is 0, show button text as "cance

React router - useOutletContext testing

I'm using react-router V6 and trying to test the new feature of useOutletContext. my testing library is testing-library/react and I'm not sure how to pass the C

How to use Material UI (mui) 5.0 inside an iframe?

I'm trying to render MUI components inside an iframe using react portal. Although they are rendered inside the iframe, they lose all thMUI components lose their

Not able to link a component in react js

I wrote a code to fetch a list of contacts, after clicking on the view detail button on the contact card, it should open a new page showing the contact details

Why Context API is worse than Redux for high frequency updates?

I saw many articles that Redux is better than Context API in performance than high frequency updates, but nothing is specific and tell why. What makes people sa

webpack < 5 used to include polyfills for node.js core modules by default

I am beginner to react js. Please someone provide input for below issue. In local system react js application is working fine but when i am generating build fr

CORS Error while calling .Net WebAPI from Axios

I have a login form from where I am calling the .Net API from react using Axios axios .post( 'https://localhost:5001/login', { email: 'abc@gmail

How change the size of UI Chip dynamically

In the following example, I am trying to change the size the UI chip in dynamically in order to respond to the font size of its parents using the em css unit. M

Routing is not working after createing of of react app in MERN app

I created a MERN app that has a node.js server. To host the website on Heroku first I have to create a build folder by it using npm run build. After that, I hav

TypeError: Cannot convert undefined or null to object in NextAuth

NextAuth.js automatically creates simple, unbranded authentication pages for handling Sign in, Sign out.So I created it like the document suggest.I created in s

Use react-ace diff component cannot showing the diff change

I want to show the different change between two side contents, but the results are not showing what I expect them to. No changes are showing. The version I am

Why isn't my React context being updated?

When I use the app and navigate to the SetContext component, I see the value of auth is correct ("dummy value") and after entering a value in the edit field and

Not able to load image using img element in ReactJS

Api: http://api.openweathermap.org/data/2.5/weather?q=Canberra,Australia&appid=8d2de98e089f1c28e1a22fc19a24ef04&units=metric Image Source I want to load

Is there a way to handle number inputs instead of string with React Native?

I have a react context state for my multi form input values: const [formValues, setFormValues] = useState({ sex: "male", unitSystem: "metric", hei

How can I remove the last comma from a map?

I have, { mydata.map(({ name }) => ( <p style = {{ display: "inline" }} > { " " } { name }, </p>)) } How can I remove the last c

Cursor is going at the start automatically in contentEditable

I am creating a website builder. For Text edit, I m using contentEditable and to capture its state I m using the onInput event. but I don't know why every time