Category "reactjs"

Why need useRef and not mutable variable?

I have read A Complete Guide to useEffect - Swimming Against the Tide at Overreacted. The example shows that if we want to get the latest count, we can use us

Server Side Rendering for improving SEO of landing page in already existing React + jQuery Website

I have an already existing website that has a pretty huge codebase. It was initially built in jQuery and is currently being migrated to ReactJS so both are used

Trying a responsive navbar in react and tailwind css but not working in another resolution

so im trying to create a responsive navbar with reactjs and tailwind css this is screen 1 in this size the screen is responsive here it is not responsive so I w

ReactJS No routes matched location because of question mark in query string

Hello I have a react app with this route, I use react-router-dom. <Route path='/contacts?page=:page' element={} /> And I navigate like that: navigate(/

React Router V6 - Error: useRoutes() may be used only in the context of a <Router> component

I have installed react-router-domV6-beta. By following the example from a website I am able to use the new option useRoutes I have setup page routes and returni

Flowbite Navbar Component is not working in React App

I used Navbar from Flowbite Tailwind CSS Component. But lately, Flowbite's Navbar dropdown menu is not working in my React app project. Is it not working for th

Map Dissapearing After Calling JumpTo (MapboxGL + React)

I'm developing a website that takes in an address from a user and plots a list of nearby locations using MapBoxGL and React. When the user runs the search, an A

Jest test case for React hook component

When I write a react hook component which import '*.png' resource like this: import React, { useState, useEffect } from 'react'; import './topMenu.less'; im

React(Next.js) conditionally render only once

I wanted to create a welcome page that disappears after some seconds, and I've found on youtube a video that did something similar, but it's more like a loader.

Problem: ParserError: Syntax Error at line: 1, column 32

I am new to programming and I am with this problem. When I put in the Terminal "npm run build" to create the compression of my project in React.js I have this e

Changing Theme with Material ui V.5 - Compiling error Importing styles

I need help using material ui custom theme. It get Error in style components. I have already installed the following: npm install @mui/material @emotion/react @

context.putImageData() Not working in React

Im trying to create a drawing application in react, its working for the most part. But when i try add an undo button it doesnt work. I try make the undo button

How to get origin or domain name in Next.js [duplicate]

I can get the relative pathname using useRouter().asPath which gives something like /my-awesome-post but how to get the origin? Similar to wha

Nextauth token keeps on nesting

I updated with v4 beta with next-auth. But the token keeps on nesting on refresh, as in token converts to token.token to token.token.token .... on each refresh

Is it possible to extend the borders of table data <td> to align with content that has been moved via negative margins?

I have a collapsible table, which opens and closes when clicking on Accounting. It requires a unique layout. I have added a checkbox to my collapsible rows, w

create-react-app without removing existing files

i have an existing project folder that contains project assets, some text files, &c. and we're having to use React on this one. when i run create-react-app

How to configure react-app-rewired to add a postcss plugin

How can I customize react-app-rewired config in CRA v5 to add a postcss plugin, for example this one? I checked react-app-rewired documentation and github issue

Some instances of a ReactJS component won't update

I'm developing a VOD app for TV and I'm having an issue with updating an element inside of a slide component. Basically, when a costumer focuses on any of the s

Animate component unmount fade-out in React Native

On a React Native application, given a condition is true I should render ComponentA, else ComponentB should be visible instead. const ParentComponent = () =>

sending props to @react-navigation/drawer component

I am trying to send prop to component inside Drawer.Screen. I am using @react-navigation/drawer. I finally send props to navigation container but I cant send pr