Category "reactjs"

How to setup react properly

I have been following the react setup instructions on codecademy: When I type in "npm run build" into the terminal I get this error: I can't seem to figure out

Flash Of Unstyled Text (FOUT) on reload using next.js and styled components

I'm using global style from styled components with next.js and every time I reload my page I can see the font flickering. I have my font files in public/fon

React, component not re-rendering after change in an array state

The component is not rerendering after the deletion of an element in the state but the state does change. In the component, you can add an element in the array

makeStyles in Material UI not applying

I am trying to style my pahe using makeStyles from material ui with react js. it is working for me with some pages, but most of them are not working even if I a

Why this.state is undefined in react native?

I am a complete newbie in react native, react.js, and javascript. I am Android developer so would like to give RN a try. Basically, the difference is in onPre

Can't Load Models for face-api.js

I don't understand how to load the "models" so that the client side of my React web app can start analyzing images. I don't even really understand what a "mode

Invariant Violation: _registerComponent(...): Target container is not a DOM element

I get this error after a making trivial React example page: Uncaught Error: Invariant Violation: _registerComponent(...): Target container is not a DOM elem

Websocket error when using a proxy_pass to CRA development server using Nginx and Docker

I am trying to proxy_pass in Nginx to my React dev server at localhost:3000. It currently works but I am seeing an error in my console which I am unsure will ca

React Pagination Styling

I am using react-js-pagination npm package, but styling doesn't work for me. import Pagination from "react-js-pagination"; import "bootstrap/less/bootstrap.les

React-Router External link

Since I'm using react-router to handle my routes in a react app, I'm curious if there is a way to redirect to an external resource. Say someone hits: example.

How to get current navigation state

I am using React Navigation's Tab Navigator from https://reactnavigation.org/docs/navigators/tab, when I switch between the Tab Screens I don't get any navigati

Using Dividers inside Material-UI Tabs

If I want to use a Divider or something else that isn't a Tab inside Material-UI Tabs, I get DOM warnings in the console. <Tabs ...> //... <Divide

useLocation: Hooks can only be called inside of the body of a function component

I'm trying to use the useLocation hook in my function component but I'm getting Error: Invalid hook call. Hooks can only be called inside of the body of a funct

Error while trying to create react app using npm

I'm trying to creating react app using create-react-app command but I get this error message: npm ERR! code ERR_SOCKET_TIMEOUT npm ERR! errno ERR_SOCKET_TIMEOUT

Chained Fetch Promises (JSON, React, Webpack, NodeJS)

I need to fetch something 10 times and return the JSON of each request and push that into state. Most of the fetching works, but slows down about half way and h

Call multiple functions onClick ReactJS

I know in vanilla JavaScript, we can do: onclick="f1();f2()" What would be the equivalent for making two function calls onClick in ReactJS? I know calling one

React - how to capture full screen video request in html5?

I have a HTML5 video element in my React component. I would like to implement a custom function for clicking on full screen button. So that when on clicking the

Airbnb react date range picker only showing current month calendar not selected dates month calender

I'm trying to add airbnb-react-date. After selecting start date and end date when I am re-opening the date picker the calendar shows current month instead of th

Disable Ripple effect on MUI Button and add custom

I wanted to remove the ripple effect on the button and implement my custom effect in MUI Button. I have removed ripple using disableRipple. I have tried to appl

Error when running npx create-react-app myapp on fresh install of node.js

I followed the reactjs.org website for create-react-app to a T I haven't been able to find this specific error anywhere, and most posts are years old; irrelevan