Category "reactjs"

VM892:1 Uncaught SyntaxError: Unexpected token e in JSON at position 0

I'm presently working on a phx / phoenix API written in Elixir. And I have created a frontend for the API using React.js. However, I'm getting the below error

next/image loads very big images

I am using Next js in my project and using next/image for loading images. My page is roughly 1600px wide and has 3 thumbnails per row which are of 500px in widt

Formik onSubmit function is not working on my code

I am creating a form by using react and formik.Below is my code: <div> <Formik initialValues={{ email: "" }} onSubmit={(values: FS

Mui DataTable custom summary footer

Given the follow example: https://codesandbox.io/s/l49mrmvj67 Will it be possible to add a custom footer that will sum the current page Salary column and displa

React js character limitation

Im trying to implement a chartercter limit for a textArea in react js here is my code. state = { chars_left: 140; } handleWordCount = event => { const

Next.js dynamic import with server-side-rendering turned off not working on production build

I'm currently building a site using the leaflet package. This package however needs the window object. That's why I'm importing a component made with leaflet as

How to build a production version of React without minification?

Background I've been following more or less the official guide to setup a local dev environment with react and it seems to use create-react-app, which sets up

How to apply to different bground color for each area in Chart.js

In react-chartjs-2 In Line chart every grid should have different background colors. Is this achievable with this library? This is how LineChart should looks:

react-google-login not calling onSuccess

In the following snippets I'm trying to implement google oauth into my webapp using npm react-google-login. When I try to sign-in, the popup appears, I select o

Why Web3 .GetReserves() is spamming my console?

My code below gets the data correctly; however, there is one problem where when I try to get the reserves of a token. It spams the data over and over again to t

How to upload an image in React JS?

<div className="mb-1"> Image <span className="font-css top">*</span> <div className=""> <input type="file"

Environment variable undefined error in node.js

server.js const express = require('express'); const dotenv = require('dotenv'); const error = require('./middleware/errorMiddlewareHandler'); const usersRo

Updating an object with setState in React

Is it at all possible to update object's properties with setState? Something like: this.state = { jasper: { name: 'jasper', age: 28 }, } I have tried:

How to test for document being undefined with RTL?

I have the following react hook which brings focus to a given ref and on unmount returns the focus to the previously focused element. export default function u

Curved view shape in React Native

I wanna replicate the following layout, where there are 2 views (one with white background and the other one with a blue background). The issue is, I can't rep

How to set a default value in react-select

I have an issue using react-select. I use redux form and I've made my react-select component compatible with redux form. Here is the code: const MySelect = pro

REACT - Express : fetching data doesn't work on reload when user connected

I've deploy my first app using React with Nodejs/Express/MongoDB but I'm running through a bug I couldn't find any solution, so I'm coming here to find some hel

In React Login component Firebase Login signup is working but when I am trying to send a reset password Link then is Not sending to email

In React Login component Firebase login signup is working but when I am trying to send a reset password Link then it is not working. there is no getting email v

Types of parameters 'event' and 'event' are incompatible

I have a project, which is an employee monitoring project, and it has several components, and among these components is having a group of buttons together. I ha

React-toastify toasts don't close

I have a react app and I use react-toastify to prompt for certain messages. However, whenever I click the x on the toasts they don't close. They do, however, cl