Category "reactjs"

Heroku application crashed: at=error code=H10 desc=“App crashed” method=GET path=“/”

*I have been trying to upload my MERN app to Heroku and have been getting these error codes. The web application will run on my local host but the application i

Customize code folding for .js and .jsx files in vscode to achieve folding of className='...'

I am looking to fold the className attribute in my react app, as I am using tailwindcss and thus the classNames get quite long, cluttering my files. I've come a

"ReferenceError: Must call super..." when passing raw JSX arg to super in derived class

Trying to run the following in a React app gives the ReferenceError (below). Why? I'm calling super(). Is the JSX somehow "accessing 'this'"? class Base { con

A blank white screen in the React Navigation. React Native

I have a project on React Native and sometimes when errors occur, the application gets on the wrong route in the React Navigation. Therefore, I get a blank whit

How do you use an SVG inline in React using Parcel 2?

Previously in Parcel v1 you could just use something like the @svgr/parcel-plugin-svgr plugin for Parcel. This would give you the ability to use SVGs inline lik

ReactJs this.setState is not a function

I'm trying to change the value of a this.state.id with an <input> tag value, when I click on a <a> tag as follows: {this.state.json[1].map(i =>

Reactjs build failed attempted import error: 'widget' is not exported

I created a new React project with Typescript and I copy and paste old file from another project which is just .jsx file. This file is importing a class called

Getting an error when trying to deploy a react app to heroku

I'm trying to learn how to deploy a react application to heroku, but I keep getting an error message whenever I do a test run. I've been using the following co

How to intercept back button in a React SPA using function components and React Router v5

I'm working in a SPA in React that doesn't use React Router to create any Routes; I don't need to allow users to navigate to specific pages. (Think multi-page q

React.lazy() vs React Loadable

I was using react-loadable for some time for dynamic imports of my React components. In the recent React release 16.6, the React team has included React.lazy

Fixed Table Header React-Bootstrap-Table-Next

I'm having issues making my table header fixed when scrolling. My React Table: <div className="Rules-Container"> <BootstrapTable striped

Can we use object destructuring for useState() in reactjs hooks?

As from the documentation from Hooks in Reactjs, const [count, setCount] = useState(0); they use array destructuring. Can we use object destructuring in pl

How to paginate Cloud Firestore data with ReactJs

I'm working with Firebase - Cloud Firestore and at the moment I would like to paginate all the records available. I already have a list of records and what is l

get value when updated,outside of formik using useRef()

I'm trying to get the value of an autocomplete field outside of my formik component everytime it changes, and i did something like this: const formRef=useRef<

Use imports with string that comes from localStorage

I need to show/hide different menu based on rights that are send from database and saved in localStorage. Here is the imported menus import tripOrders from './t

React native randomly crashes with error 'Attempted to remove more RCTKeyboardObserver listeners than added'

My react native project on iOS simulator crashes randomly with this error when I open and close the ChatRoom screen, I guess it's a problem with the react nativ

Why is my favicon not working in my next js app?

For some reason my favicon is not working. I have the favicon saved as favicon.ico in the /public directory and am referencing it in the <Head> of my pag

How to assign two refs to same element

Here I am trying to assign React dnd "drag" ref to existing ref but it is not happening, can any one please help me. const refs = useRef<(HTMLDivElement |

How to theme Material UI inside Storybook

Currently this is what I am doing, passing a ThemeProvider above my component file: import React from 'react'; import { ThemeProvider, createMuiTheme } from '@

How to create multiple node types with mdx in Gatsby?

I am trying to create multiple content types in Gatsby using mdx (instead of remark). I am having trouble sifting through old methods of handling remark and new