Category "reactjs"

"SyntaxError: Unexpected token < in JSON at position 0"

In a React app component which handles Facebook-like content feeds, I am running into an error: Feed.js:94 undefined "parsererror" "SyntaxError: Unexpected

React-native: "could not connect to development server"- android app

I am following guide on starting react.js. http://code.tutsplus.com/tutorials/creating-a-dictionary-app-using-react-native-for-android--cms-24969 I installed n

React JS React Query's useMutation: Unable to retrieve the response from the server within the onError callback

I am working on a React JS project. I am using React query, https://react-query.tanstack.com/ to make API requests. I am now having a problem with mutation retr

Material-UI: Too many re-renders. The layout is unstable. TextareaAutosize limits the number of renders to prevent an infinite loop

I have the following piece of code: export function MyTextField({ onChange, defaultValue }) { return ( <TextField defaultValue={defaultValue}

ant design onSelect is not firing

I'm trying to use Autocomplete from Ant Design, but the "onSelect" is not firing. Everything else is working well - when I type into the search bar, my ingredie

Custom React Hook typescript error on array return type

I've created a very simple custom hook: export function useI18n() : [ string, Dispatch<SetStateAction<string>> ] { const [ language, setLanguage

How to implement Razorpay payment button in next.js page

Using the Razorpay payment button on the website is quite simple it gives a code like <form> <script src = "https://cdn.razorpay.com/static/widget/p

React query mutation: getting the response from the server with onError callback when the API call fails

I am working on a React JS project. In my project, I am using React query, https://react-query.tanstack.com/docs/guides/mutations. I am using mutation to make t

Custom React Hook typescript error on array return type

I've created a very simple custom hook: export function useI18n() : [ string, Dispatch<SetStateAction<string>> ] { const [ language, setLanguage

Cross Domain Cookie Golang ReactJs

In Go, I am setting the cookie for frontend: http.SetCookie(w, &http.Cookie{ Name: "jwt-token", Value: tokenString,

How to make React-Material UI data grid to render rows using alternate shades?

I am evaluating React-Material grid for my customer. One of the key feedback was the absence of alternate shading of rows, which impacts user experience. https:

React native web support

I have project in react native and it was build in iOS and android successfully. I have not used react native cli for that project. Now I have to give support f

How can i redirect after successful submit of form using react-redux

action.js import axios from 'axios'; import { EVENT_ADD_FAIL, EVENT_ADD_REQUEST, EVENT_ADD_SUCCESS } from '../constraints/eventConstraint'; const addEvent = (e

How do you get "x-" headers in Next.js

I am following an example from Sara Vieira's Opinionated Guide to React. In the example, she is doing something like this: export async function getServerSide

Centering Modal Title and button in React Bootstrap

I am trying to implement React Modal for my project. I want to center the Modal Title and Modal Button. I tried to use flex and just-content-center but it didn'

Can we pass setState as props from one component to other and change parent state from child component in React?

class App extends Component { constructor() { super(); this.state = { name: 'React' }; this.setState=this.setState.bind(this) } re

"Import in body of module; reorder to top import/first" Across Many Files

I have the same error as this answer, except instead of it just occurring in one file it is occurring in many; once I fix it for one file, another just pops up

Module not found: Error: Can't resolve 'react-dom/client'

I am using react with the following packages: { "name": "demo", "version": "0.1.0", "private": true, "dependencies": { "@testing-library/jest-dom":

Rollup preserveModulesRoot not working as expected

I feel like the preserveModulesRoot option while using preserveModules does not work as it should. Let's say I have a src/index.ts and a bunch of src/components

Setting homepage in package.json doesn't set PUBLIC_URL on build

Following the docs here (Building for Relative Paths), so setting homepage field in package.json doesn't set PUBLIC_URL during the build. Expected behavior %P