Category "reactjs"

How can I use a React context variable when initiating i18next interpolation?

The React app I'm working on is using react-18next. Inside the index.js file, there is a i18n.js file imported into it that configures and initiates i18n. This

Cache manegment in recoil js

I decided to try using recoil instead of redux and ran into the problem of caching mutable collections. To be more precise, the problem is not in the response c

React build suddenly fails inside Docker image

This error is only happening inside a Docker image build: TypeScript error in /app/src/index.tsx(12,10): 'Provider' cannot be used as a JSX component. Its ins

Conditionally render component views based on browser screen size

I have three different components representing different views for screen sizes. I want to render one of them based on the browser view width. I've managed to g

how to switch between inputs in converter app in react?

I built a celsius(as input) to fahrenheit(as output) conveter with react But I want to switch between celsius and fahrenheit as input and output I mean when I c

How do I find out the aria role of MUI components for RTL querying?

I've just started migrating from enzyme to react testing library on my project that uses material-ui. From what I understand, RTL queries the dom and the recomm

Metro has encountered an error: While trying to resolve module `@apollo/client`

I am trying to install GraphQL into my React Native app and in doing so, I was given this error message. I have confirmed that the file actually exists and have

what should be the default value of file in react-typescript in useState

How do I initialize a file through useState in React Typescript? const [images, setImages] = useState<File>(); const [formData, setFormData] = useSt

How to reference image in an array?

I have some data im using in an array that looks like: import image from "./image.jpg"; export const data = [ { id: 1, title: "kevin", content: `G

Material-Table columns not resizable with more than 5 columns

I am displaying data using material-table. I have 19 columns to display and I want to set a fixed size for each column. Using width: 45% is not making any vis

how to Show All the users information from firebase to website

I am trying to show all the user's images on my react website. But I can only find the current user information using react-firebase-hooks/auth hooks. How can I

How to get the user's phone number using react-google-login?

I'm actually using this React library (https://www.npmjs.com/package/react-google-login) to authenticate with Google. As for the basic profile and email scopes,

Why is my useEffect not being called when I take a item out of my cart in React?

I am doing a simple food ordering web app with React and for some reason, I can't get my useEffect to run when the cart is changed with the X button to delete a

Unable to run unique iterations for individual objects

I'm trying to present 25 entries (name, company, skill, etc.) on the page and am having trouble getting the unique information. i.e. I only see the first entry

Dynamically add circles to react leaflet with blockchain

I have read this post which partly answers my question, but my problem is the infinite loop that the provider.on method creates with setData(_data). I simply wa

React useEffect Dependecy releated Problem

In React I have used useEffect to fetch data. But I have confusion when I have to mention the dependency and when I have to keep it empty

How we can update the state of button to logout after successfull login in react redux

Here after successfull login im redirecting to homepage. How i can change that button to logout and when i again click on that logout button how can i again cha

Routing to a page when the id needed is not contained within the current page

I'm working on a project where I have returns and orders. My returns are stored as arrays with information such as _id, orderId, orderItems, etc. In my project,

How to play sounds correctly?

I need to run sounds automatically in React. In order to run sounds, I use a non-standard useSound hook. It creates a button and by clicking on this button the

How to pass id in path url as component property in react router v6 [duplicate]

I'm updating an outdated tutorial project using react hooks and react router v6. I want to pass the id in the path url to the component proper