Category "reactjs"

Vite - change ouput directory of assets

By default Vite generates files in the source directory under dist. my-app/ ├─ node_modules/ ├─ dist/ │ ├─ assets/ |

REACT- Making 2 different dynamic displays depending on a selection checkboxes ( everything is on the same page now)

depending on the selection of my user Change the type or Choose the comments (he can select only one choice), there will be a different display, but my code dis

before pseudo classifier not working in React

I wanted to apply a background image to the whole of my react app and give it an opacity. I used the following code to do so. .App::before{ content:""; ba

Migration v4 to v5 Breaks Styling of Basic MUI Components

I am upgrading from v4 to v5 and having significant problems that are inconsistent. The <Button> component looks as it should on the Login page, but once

Vite - change static assets' directoy

I had build an app using create-react-app. And our server is set up as such that all files except index.html are in a folder named static. <!DOCTYPE html>

Type argument at moment of use

I'm trying to build a generic tool for handling the response to React Query useQuery requests in my app, and build this out using TypeScript, so that the data i

Axios API request from React Native frontend to local spring backend service not working

I develop a React Native mobile app and for the backend I want to use Java Spring. Now I have a standalone backend server running locally on port 8080 and my re

How can i hide long description and making it toggle in react js?

I face a problem. my reactjs application has some card items and has some descriptions here. Here I want to make it a short description and a button, and when I

React JS useParams

I am trying to display the content for each page using useParams , but it doesn't work. I will put some screenshots below with the components. Every single obje

useEffect is not called when dependencies change

import React, { useState, useEffect, useRef } from "react"; import ReactDOM from "react-dom"; import "./styles.css"; function App() { const [minus, setMinus

"No routes matched location" error in React

I am creating a React app which can be used to manage company events. There are two components related to events that aren't working at the moment. These are th

How to get the returned data from a smart contract function using ethers.js?

I'm trying to consume a function from a smart contract using ethers.js. The function retrieve the info of a user logged before (with the help of other function)

GraphQL: unexpected variables in variableValues: first when using no variables in args

My GraphQL Query works just fine in Hasura Client but fails to work when I use the query in my React code using Apollo, I don't understand why because I am not

Import web3 not found... in solana web3.js

I npm installed everything, yet only web3 is not working? Is this a bug or is there an alternative to this solution? import React,{useEffect, useState}from 're

Import.meta.env undefined on production build vitejs

I am using vitejs to compile my react app statically, however after build .env imports become undefined which is not the case on development stage. reading the

React unsubscribe from RxJS subscription in useEffect

A quick question regarding RxJS in useEffect hooks I've noticed the React community uses this unsubscribe pattern with RxJS: useEffect(()=>{ const sub = in

How to rotate material-ui icon

I'm trying to rotate material-ui icon using css property animation but not getting the desired result. Can somebody please help me identify what's going wrong h

(Gatsby) How to pass image source as a prop in MDX component

I'm trying to create a Figure component in which I pass the img src along with other data. I realize it's not straightforward—e.g., this thread—but

How to clear a React Bootstrap textarea form control after the form is submitted?

I have a form made with React Bootstrap to semply submit a string that will be saved on a DB. It works and the submitted message is saved, but I don't know how

React Native Components Override styles "leaking"

I'm trying to build my own component library specific to my React Native app using the Atomic Design Methodology, so I have small components like Paragraph, Tit