Category "reactjs"

React Quill Installation

I have a problem while installing react-quill. The error message I have got is: unable to resolve dependency tree. How can I resolve this issue?

Why side effect is not ok in React

I was learning React and localStorage. Then, I came across an article saying that localStorage is best to be used via useEffect() due to side-effects. So, this

useState hook does not update inside setTimeout function

this code must increase the "count" value gradually from 0 to 600. And each time the "count" value changes it must be logged into the console. But instead, I ge

useCallback with onchange function in React JS

I have 2 components. In the parent component I have this: const Demo = () => { const [state, setState] = useState(true); const onChange = useCallback(

GitHub gh-pages to work with the app domain name?

I deployed a react app on gh-pages. The problem is that the URL, like https://username.io/react-app-name doesn't work. I'm running into a problem, because the a

Next.js how to implement react-google-recaptcha in my contact form

I am trying to implement Google Recaptcha on my contact form in Next.js. It does popup the challenge when needed, but sends the form anyway. Here's my code so f

Implement Tab Screen in React Native

I'm facing a weird problem. In my react native app I have a return <Tab.Navigator> which contains <Tab.Screen>. The problem shown in the image is no

Using fetch api for uploading image using presigned url amazon s3

Hi I am trying customer upload their picture to amazon s3 directly in reactjs web app. I am generating presigned url in the backend like this def get_presigned

React-Scroll - Link not working - appears as empty <a> tag in html

UPDATE 2: Solved. It was due to poor styling. I have a background div in my app that I had set overflow: auto; and it was stopping react-scroll from working. It

React-Chartjs-2 and Chartjs v3:Option Property

i whould like to start with react-chartjs-2. The first thing that i have seen on the offical website, v4 -> imigration to chart.js 3. On that website there w

Module parse failed:.You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file."

I am facing the below error. I tried with all solutions mentioned in other post related to the same issue. But no luck. Please help. Error:- **ERROR in ./src/i

What is the correct typescript type for react children?

I'm trying to properly type the props for a component that maps children: type Props = { children: any } const MyComponent: FunctionComponent<Props>

Error: The style prop expects a mapping from style properties to values, not a string when onUploadProgress axios React

i have a redux action to upload image const uploadDokumen = (file) => async (dispatch) => { try { const data = new FormData() data.ap

Formik onChange is not working for dropdown using react-select

Below is the code where I am trying to select value from dropdown. handleChange is not working, when I select the value from dropdown it's not getting updated w

`Property 'ethereum' does not exist on type 'Window & typeof globalThis'` error in React

I am getting the Property 'ethereum' does not exist on type 'Window & typeof globalThis' error in React. This is the line generating the issue: import { eth

How to update location.state in react-router v6?

I'm using react-router-dom v6. When using useNavigate like this: let navigate = useNavigate(); navigate("/", {state: state}); I can access it by useLocation().

Spotify Embed code (iframe) won't work in Markdown

Using React-Markdown on Next.JS, the post pages are stored as Markdown files, but for some reason the Markdown file won't render the iFrame. However if I use a

Ant design onFinish function with typescript; Type '(values: FormData) => void' is not assignable to type '(values: unknown) => void'

I have interface FormData, which is supposed to be same type as values that onFinish function receives, but when I put const onFinish = (values: FormData) =>

Tailwind custom background-image not working in production

In my CRA project I've added my own background images by editing the theme.backgroundImage section of my tailwind.config.js file. The images show up locally bu

react-scripts build generates wrong path for sub folder

My application should be served at /sub-folder so in the package.json the homepage field is set to "homepage": "/sub-folder/", The production bundle generated