Category "reactjs"

Head (next/head) throwing error in NextJS

I am trying to add head to a page in NextJS. As per the documentation I have used next/head to add <head>. However, the code block for using next/head is

Head (next/head) throwing error in NextJS

I am trying to add head to a page in NextJS. As per the documentation I have used next/head to add <head>. However, the code block for using next/head is

I am trying to get data from my sql database to my react page, but my api returns an empty array

http://chucklets.no/getOnlineTime When I click this I can see the JSON and it looks fine. But when using fetch it API Node.js code: app.get('/getOnlineTime', (r

I am having issue with my image src in next.js [duplicate]

I am using Sanity image url in my project and I am getting this error in my console page that says next-dev.js?3515:25 Warning: Prop src did

Error: Element type is invalid thrown by reactjs

for the code below in next.js index page import { Typography } from '@mui/material/Typography'; import { createTheme, ThemeProvider } from '@mui/material/styles

Changing a variable initialized in the outer scope after fetching using mysql

I'm trying to make a history page where users can see the videos they recently uploaded or downloaded. I'm writing it in NextJS. I'm using Mysql to store the da

How to populate array of arrays in react state variable?

I'm trying to add an array to an array of arrays every function run. How can I append the array to my array of arrays state variable? Here is my code: const [vo

I have used circle marker to show places on a world map in react. How to add popup on circle marker to shows up the location when circle is clicked?

I have used circle marker to show places on a world map in react. How to add popup on circle marker to show details when circle is clicked. Currently the code s

Using user info in AWS Amplify GraphQL schema

I am trying to structure a database for my application and one critical portion of it is the users association with various models in the databases. I am using

Error while installing react-toggle in VS Code

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found:

How to pagination data to optional parameters

I'm Using react-bootstrap-table-next pagination module, In that I am using sizeperpage How do I pass sizeperpage data to the params. code excuted: <Bootstra

Filter is not a function using React UseEffect of a data from MongoDB

I am working on a MERN ecommerce stack application. I have an API that returns all the Products I have from my MongoDB. I have attached a console log of the pro

problems loading data in ScrollView

I want to make a ScrollView that uses data that it async fetches from my backend. But for the moment when I try to render the subject, or even log the subjects,

Fetch runs in a loop

I am fetching data in my react component import React, { useState, useEffect } from 'react'; import { fetchBookData } from './bookData'; import "./App.css"; ex

Property 'children' does not exist on type after assigning type React.FC to component

I have assigned type React.FC to my component but I still dont't have access to the children props. I get this error "Property 'children' does not exist on type

NextJS Global Variable with Assignment

I'm new to NextJS, and trying to figure out, how to create a global variable that I could assign a different value anytime. Could someone give a simple example?

Which one is more efficient on saving rendering? (React)

I am wondering two cases, which is better for writing? case 1 import * as React from 'react'; const TestComponent:React.FC = () => { const [count, setC

How Do I Call An Authenticated HTTP Trigger Google Cloud Function Via A Next.js (with Typescript) App?

I created a Google Cloud Platform account, and made a simple hello_world type Python "Cloud Function" that just spits out some simple text. I made this function

How to cleanup this fetchEvent function used in a useEffect hook? [duplicate]

useEffect(() => { const fetchData = async () => { await fetchEventSource(`/weborders/${agentId}/web_stream`, { method

React-intl with a custom react components library

I'm having a hard time to create a react library that supports translations. Let's say I have this structure components |- Button1 |- Button1.tsx |- ind