Category "reactjs"

How to add recharts to react-pdf

I am using 'recharts' to create graphs for my project, and 'react-pdf' for generating a report. 'Recharts' creates a svg on the DOM when using it and a graph is

How to test that my input has a ref attribute?

I am using React Testing Library and I have a component that takes in a prop value for a ref that will be used within a <input />. const InputComp = (ref)

How to pass item's data to another component, edit data and save data in React.js?

I have a book table page to list all the books in the database, mapped with their book ID. If I click the book name, it will link to an edit book page, in this

ReactJS Formik display error message in Red color

In ReactJS i am developing one Class component and using Formik for validation. I am able to do validation but error message is display as a normal color (blac

JS how to add hours and minutes to scheduled date

I need to be able to let clients schedule a certain type of meeting for a future date, the meeting duration I get back from the database is in minutes. I need t

How to create a string array in the useState hook and update that same array in TypeScript?

I have a React project where I am trying to create a multi select function where you can select and deselect multiple avatars at once. So far I have this: expor

How to add marker to google map based on data from API react

So I have been trying to implement a google maps instance on my NextJS app, I got most things to work however, I want to display the data I'm fetching from an e

'CI' is not recognized as an internal or external command, operable program or batch file

Whenever I try running npm run build in react, I get the following error: 'CI' is not recognized as an internal or external command, operable program or batch

Is the parent object reference changed if a child object is changed?

Suppose I have this let a = { data: 'old' } Lets say hypothetically that a has a reference to '123' If I do a.data = 'new' Is the reference of a still pointin

React(Typescript) onchange event type

In My React Component I have Radio input <input type="radio" onChange={changeData}> and function changeData(e: any) {} How can I speci

How to check if the fields exist in a document

I have a user collection and I'm trying to search if the first and last name exists and if not, I just want to put a display message that it does not exist. I t

Custom onChange for React Hook Form and watch()

I am trying to write a custom onChange and watch the change. Error: The watched myValue does not register the changes in the dropdown. Any ideas why? According

How do i use localstorage in React native?

I have a web app that I want to convert to an native app with react native. So I started the project and all the logic is the same as the web-app but i don't kn

Apply motion to react component Framer-Motion

I know that I can apply motion directly to element/HTMLtag like this: <motion.div>some content</div> But how can I apply it to this? <Comp />

How can I get the all html code into view page source as I am developing a project in NEXT.js

I am developing a project where i am using NEXT.js but there i am getting a issue like i am not getting the all html value in view page source. I think my probl

How to upload multiple files in different folders using Reactjs and Laravel

I want to let users of my website upload multiple files that could be in different folders. Using 'multiple' attribute in file input control doesn't let you sel

How to deploy React client and Node server (Both in a single git repository) in Heroku?

Am having a single Git repository where it contains both client and server. This is my Webpack.config.js const path = require("path"); module.exports = { d

Convert blob to pdf file

Using react-pdf's BlobProvider, I'm trying to store the file to state. Here's what I tried: MyDocument = () => { return ( <Document&g

docker bind mount not working in react app

I am using docker toolbox on windows home and having trouble figuring out how to get bind mount working in my frontend app. I want changes to be reflected upon

React JS - Reset Form Data after Modal Close

I'm trying to reset my form data when a modal closes. I think part of my problem is that the form data <Mint> is in another component. Honestly, any time