Category "reactjs"

Why getting Cannot read properties of undefined (reading 'object') error?

I have a react application having a community chat feature. The code for the comment section is : I am a newbie to this error and have no clue about it, can som

17 renderings before showing view - React JS

I'm starting in React. I'm working on an old project that does 17 renderings before showing a view. I have no idea where the problem is. Has anyone ever experie

getting error "TypeError: Cannot read properties of null (reading 'useState')" on useState usage react

So I'm trying to use useState in my nextjs app, but as soon as I add in the line of code to initialize useState it throws a popup error with the error message:

Unable to resolve npm install pre-gyp error

I am trying to install this app locally on my m1 MacBook air > Github - Todoist Clone Running npm install in the terminal is causing the following error, ple

Use 2D Colormaps Javascript Plugin in React

I'm new to JavaScript and for an assignment I need to use 2D Colormaps Javascript Plugin (https://dominikjaeckle.com/projects/color2d/) for visualization. I kno

FluentUI TextField onchange does not fire errormessage

So I've been working with FluentUI and I've setup a TextField with a onError Property which fires but it only fires when starting the app up. When changing the

How to make React search component

I am doing my first Ecommerce MERN stack project but i donot know how to make search component that will take the search input and return array of matching prod

I want to change state of the component without reloading metro in react-native

so basically i have bunch of apps in my application as you can see in image In my app it check if application is installed or not, if its installed its shows op

Two classes on single react HTML element

I feel like there is a simple answer here, but I'm not finding it - In my react header I import my stylesheet under 'styles' and as such refers to css classes a

React get value of object from localstorge

I get data from localstorage. I used useEffect. But when I want to get a value in object, I got problem. const [carinfo, setCarInfo] = useState(); useEffect((

MediaSource never emit sourceopen event in React

I'm trying to stream a video file using Javascript's MediaSource API in a React custom hook. Here's the snippet of my code: const useMyHook = (videoRef: React.M

useQueries how to get response for a certain query

Is it possible to distinguish the response, we get from useQueries. For example const ids = ['dg1', 'pt3', 'bn5']; const data = useQueries( ids.map(id => (

Importing React as default module not working inside Symfony Webpack Encore project

I have a Symfony project, where the frontend-pipeline is built with Webpack Encore, I would like to add React to the project and have a React widget inserted in

Custom place of filter input in react-bootstrap-table

I'm using react-bootstrap-table and I want to place the input filter of table columns in top of the table not on top/bottom on the column (default behavior). I

Multiple locales with date-fns in ReactJs

Using date-fns, i am trying to add multiple locales in my app, before i hade one only locale so the import was simply like this : import {fr as locale} from 'da

link login page to homepage using react

I am trying to display first the log in page and then it goes to the home page but it does not work. Can Anyone figure out the problem? How Can I direct my logi

Get ETH Balance with Ethersjs

I'm trying to get the balance of my wallet address to render on my frontend. Here's what I have so far. const [balance, setBalance] = useState(""); const hand

using webpack to import files dynamically inside react component

const LongDetail: React.FC<Props> = ({ id, section, placeholder, Fromtolocation, }) => { const { setPrimary, setSecondary, create

Preserving prior form data when navigating back in Gatsbyjs

I have search page in Gatsbyjs where a filter form resides in the sidebar with multiple options. The page is generated from node.js using a template, where the

How to independently set a button click in react?

I am trying to figure out on how to set a button that can independently be disabled when using the .map function. So I created a state whenever the button is cl