Category "reactjs"

How to Check if Service worker already exists and update with workbox

Would like to see if we can detect if there's already an active service worker on the client's device. Currently I use getRegistration to do this but I was curi

Import "rest_framework" could not be resolved. But I have installed djangorestframework, I don't know what is going wrong

Here's my settings.py: INSTALLED_APPS = [ 'rest_framework', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'd

Material-ui when closing the dialog it wont let me touch my page

So after i close the dialog box of material-ui, somehow i can't click or touch anything in my page useState: const [open, setOpen] = useState(false); Function:

Warning message "DeprecationWarning: Invalid 'main' field in ....." after typing amplify

When I write amplify console in react-app, this warning message is coming. >amplify console (node:2500) [DEP0128] DeprecationWarning: Invalid 'main'

Flask + React App Fails When Deployed to Heroku

I am trying to deploy a simple flask + react project to heroku. I am using gunicorn. The application works when deployed locally but fails on Heroku. The issue

Error: `input` must not start with a slash when using `prefixUrl`

As soon as I update gatsby packages to the latest version, now version 4.10.1, or any version after 4.6, it directly gives me this error without any change in t

Lodash debounce async/await

I'm trying to add debounce to my application before I do an api call. However when I introduce debouce, it seems like my await is ignored and the function calls

Make YouTube video autoplay using React

I am trying to make my video autoplay using react. adding autoplay=1 as a parameter doesn't work. Any suggestions?` Here is my code. <div className="vide

Can't print a dict: Uncaught TypeError: Cannot read properties of undefined

I've this error: crew.js:6 Uncaught TypeError: Cannot read properties of undefined (reading 'first') From an API (I'm using FastAPI for backend) I've this ret

how to redirect from a utility function in remix run

I am using Remix-run and i want to redirect to my login page from a auth utility function. but it doesnt work. here is a similar function to my authentication u

How to automatic load .feature files

Here is an example of the (react) architecture. src/ components/ Input/ Tests/ Input.feature Input.test.js We test with react testing library and

React-hook-form doesn't set isDirty to false when back to initial state

In the official exemple for controlled inputs , if you modify the value of an input and then change it back to its initial value, isDirty will be set to true bu

How react binds events to elements generated by map

When I click discountKeyboard,it reported a mistake: Warning: Functions are not valid as a React child. This may happen if you return a Component instead of f

Formik Validation in a Field Array

I have a formik form like this:- import Drawer from "components/atoms/Drawer"; /* import Input from "components/atoms/Input"; import InputGroup from "component

fetching from an api - state react context

I am working on an app that fetches current weather for a specified location. I want to display current time but i have to use "slice()" method to get rid of th

React Native app Image does not appears in Chrome browser and GitHub link with Network Images on device

I'm trying to figure out with images in React Native <Image source={require('./assets/favicon.png')} /> and Network Images according Docs Static Image R

React: How to Animate Expanding and Collapsing Div When the Size of the Content is Not Knowable

Question: I have a React functional component that recursively renders nested lists. That part is working fine. The part that I am struggling with is getting t

Get an active route with react-router in ReactJs

I am creating a project using reactjs.In my application i am getting the active route using this: this.context.router.isActive but getting undefined, i am us

How to create a new project based on react@17

I have just discovered React. I would like to install the latest stable version of React (17.0.2), but I can't create a new project based on React 17. Can you h

`columns` is marked as required in `ForwardRef(DataGrid)`, but its value is `undefined`

I am having a weird issue with MUI datagrid. Below is the code const mcolumns=[ { field: "firstname", headerName: "Firstname" }, { field: "lastname", he