Category "reactjs"

NextJS - Appending a query param to a dynamic route

In my NextJS app, I have a language selector that's visible on every page. When I select a new language, I just want to replace the current URL by appending a q

Unable to update state while using React Native

I am trying to get to grips with the React hook useState. At the moment I am unable to update the state of my errors object, a little unsure of where I am going

Filtering the Gatsby Slug in onCreateNode

I'm trying to filter the slug generated by Gatsby so I can remove white space and replace it with "-". I have Gatsby's reporter set to fire when onCreateNode is

How Do I Change Placeholder Text on Google Places Autocomplete Component in React Native?

I have been trying to find a way to change the placeholder text for a GooglePlacesAutocomplete Component in React Native. I have tried looking through the offic

What does this render method do: const {images, selectedImage} = this.state;?

I'm doing a simple tutorial on react/ redux and I do not understand why we have to, in the render() method, do const {images, selectedImage} = this.state;

How to handle React Router with Node Express routing

I am trying to manage a react app with react router and node js server my router in react: <BrowserRouter> <Switch> <PrivateRoute tok

BrowserRouter Running Error - Invalid Hook Call

Here is my code: import React from "react"; import ReactDOM from "react-dom"; import Navbar from "./components/Navbar/Navbar"; import "./App.css"; import Home f

Display alreat message if object value exist in array of object in javascript

I want to display alert message if user type name into input field and checks if the value is same as the object value present in the array of object. I'm using

React-router - How to pass data between pages in React?

I am working on a project where I have to pass data from one page to another. For example, I have data on the first page. let data = [ {id:1, name:'Ford', co

React-Native: How to open google play store from react native app?

I am trying to find a way how to open the google play store with my application when the user is pressing a button inside of the react-native application. Is th

ElectronJS - sharing redux store between windows?

I have an electron app based on electron-react-boilerplate. Now, that I have one window running as I wanted it to run, I started to create a new window. I cur

How to implement pagination in React

I am new to ReactJS and am creating a simple TODO application in it. Actually, it is a very basic app with no DB connection, tasks are stored in an array. I add

@apollo/client TypeError: link.request is not a function

I've got this react component throwing at me this error: Uncaught TypeError: link.request is not a function at ApolloLink.execute (ApolloLink.js:65) at

Unable to resolve path to module '@aws-amplify/ui-react/styles.css'

I am getting the error: Unable to resolve path to module '@aws-amplify/ui-react/styles.css' I am using the amplify authenticator component shown in the follow

How to use MUI in Redwood JS?

I want to install MUI in the Redwood JS. But when i ran the command in the project directory yarn add @mui/material An error popped up in the console saying er

React DatePicker how to open datepicker on click of icon

Trying to open datepicker on click of icon of react-datepicker component, I have gone through their docs and issues links but found that its not much useful. &

Type text into a React input using javascript (Tampermonkey script)?

I'm trying to make a Tampermonkey script that'll automatically enter text into some form input fields. Normally, you can do this with just: myElement.value =

NextJS: Main and Nextscript

Exploring NextJS a bit for its server side rendering features. It looks really nice and easy to use. I already explored the _document.js file which we can inclu

Add space in self closing tags before in self closing tags

How do you include a space before the closing tags in self closing tags with WebStorm/IntelliJ-based products? Default settings turns <ReactComp /> to &l

firebase signOut() method doesn't sign out

I use firebase v9 and created a react hook for convenient verification of user authorization. After authorization, I can't log out on the page as if the signOut