Category "reactjs"

NEXT/Image Component URL issue

I am using NEXT/Image component and facing this issue: When I open the source code on chrome the image src is this: https://www.example.com/_next/image?url=%2Fi

Material UI 5 class name styles

I migrated from Mui 4 to 5 and wonder how to use class names. If I want to apply certain styles to just one component there is the SX property. However, I'm str

When I wrap the index.js with my context provider I just see a blank page

When I wrap the index.js with my context provider I just see a blank page. this is my context import React, { createContext, Fragment, useState } from 'react';

Google's sign in button resizes after loading

I am following https://developers.google.com/identity/gsi/web/guides/display-button#javascript to add Google sign-in to my ReactJS app. I added <script>

ReactJS push to state array replaces every exisitng value in array

I want to push an 2d array into the end of a state. But somehow, when i log the state every time it changes with a useEffect, i replaces every existing array wi

Is it possible to load a Three.js Editor exported scene with React Three Fiber (r3f)

I was wondering some issue during r3f implementation of a scene made with Three.js Editor. There is any issue about loading of json from an exported file ? func

How do I handle res.download(pathname) on frontend(ReactJS)

I have written a code on my server(NodeJS) that will send a .csv file to the frontend with express res.download(path). I would like to know how I can handle the

Formik - setting dynamic values for select box

I have a address form containing country and state field when user selects country i want to fetch state list form backend and update state select box value lis

AWS s3 / React: Password protecting site

I have a react application deployed successfully to a S3 bucket. I need to find a way to password protect access to the s3 url, for example if you open the url

useSelector and map function React Redux

i want to iterate through an array but Im not sure if i can do this in the useSelector redux hook because it's not giving me the result that i want. Have any o

How to put data inside a customize state in for loop in functional component

I get the data from the API as follows: [ { "GroupA1": [ { "code": 10, "name": "item1" }, { "code": 11,

How to return HTML in a Javascript/JSX function return? [closed]

The following snippet will return and ordinal number if I leave the <sup> tags out. But I need them so that I can style it differently t

Update webpack 4 to webpack 5 on an existing create-react-app ejected with react-app-rewired

I have an existing old react application, created with create-react-app and ejected with react-app-rewired. I'm updating the deprecated dependencies. I've alrea

REACT JS - Firebase: Data type NUMBER

Simple and quick question (And yes I google it first, got mislead to phone number verification and other stuff), Anyways! back to the point Why when I input dat

What's the difference between onClick ={ () => function()} and onClick = {function()}?

What's the difference between this code: <button onClick={()=>props.submitHandler(searchInputValue)}>Submit</button> and <button onClick={pro

How do I configure parcel to exit build with an error if eslint does not validate

I'm building a react app with parcel. I have an eslint config set up that I like, and use VSCode tools to catch eslint errors and fix them as I code. The app bu

Incorrect use of ternary operator

I want to display a progress bar and its percentages, but only while bar is less than 100% completed. This is the code I'm using: return ( <>

React useQuery called multiple times when dropdown is opened

I am using "react-query" to call an API from a component . For the purpose of this question , I am returning a mock response from the API . Every time , I open

React Native (0.63) Alert disappear automatically in IOS

I am using RN 0.63 and i am facing issue in React Native core alert.It popup and disappear automatically with second.I want alert should disappear when i click

Adding ", " after each item in a list using React Bootstrap Table

I am having problems properly displaying a list of items that is returned from the API using the react-bootstrap-table library. The returned json is structured