score:1
Accepted answer
first i think you inserted the wrong url since you have a bracket at the end of it:
const response = await fetch(`http://localhost:5000/record/gopa}`);
//instead of
const response = await fetch(`http://localhost:5000/record/gopa`);
i saw that you are awaiting twice your object:
- the first after the fetch:
const response = await fetch(`http://localhost:5000/record/gopa}`);
- the second (that seems unnecessary):
const dbdata = await response.json();
// how it should be:
const dbdata = response.json();
can you please log us the content of the response, to understand if this is the issue or if the problem comes from another part of your code? i will edit the post if that's the case
Source: stackoverflow.com
Related Query
- Getting NULL / empty data when running fetch(URL) with useEffect() in React client
- React - this.state is null inside render when getting data from API
- React useEffect returns empty array after fetching data with axios
- In react on first time data is getting fetched, when user move to chat with one another user, state value is not getting change
- React Hook useRef is null when used with useEffect
- React useEffect is returning empty data when page loads for the first time
- Why am i getting and empty array when fetching an api with react hooks?
- Getting "TypeError: Cannot read property 'classList' of null" on my React project with useEffect when trying to access a script?
- Problem with useState, UseEffect when saving data when getting data
- Getting latest state data in React using useEffect with history.block route guard
- useEffect not running at all when navigating to page with React Router
- react get data from rest api with axios and and useEffect redering empty array plus array with data
- Issue with babel-jest dependency when running npm start in a React app
- Dealing with an empty array when using .map() in React
- Getting Error: "All files must be modules when the '--isolatedModules' flag is provide" in React with TypeScript
- using useEffect in combination with Axios fetching API data returns null - how to deal with this?
- React query mutation: getting the response from the server with onError callback when the API call fails
- React Hook useEffect : fetch data using axios with async await .api calling continuous the same api
- React - useEffect running even when there was no change in state variable
- Getting json object data with react
- When the data that Apollo fetched is ready with React & GraphQL
- React useEffect hook with long running task and merge state
- Content doesn't change when back/forward made on browser with state data in React + Redux
- Getting TypeError: Object(...) is not a function with when changing Routes in React
- react redux: still getting empty object for this.props when using Connect for mapStateToProps and mapDispatchToProps
- React Hook useEffect has a missing dependency when passing empty array as second argument
- I want rerender when props data change with react hooks but i got infinite rerender
- React Hooks & UseEffect not updating display with socketIO data
- Rendered more hooks than during the previous render. when posting form data with React Hooks
- Getting duplicates when Incrementing & Decrementing using the Arrow keys with React JS
More Query from same tag
- React: Failed to import a JavaScript class from a folder
- How to install dhtmlx
- Not able to change the role and delete aria-haspopup attribute when using Dropdown
- React state change on mouse scroll
- recursive function how to save messages in array?
- TypeError: sigCanvasRef.getTrimmedCanvas is not a function
- Object key optional with typescript — but being able to call it
- Passing union typed props to react child component requiring one of the types in the union
- Best option for continuously refreshing an HTML table (SPA)
- "React.createContext is not a function" in CodeSandbox when using `@emotion/core` and latest version of React
- React JS - Display state from link
- Filtering a table from search word
- sort the product by product price from low to high and vice versa in ReactJs
- React Hooks - How to loop over dynamically created buttons to know which was clicked on?
- How to join two objects in array
- prettier in vscode is wrapping content within an html tag, which causes it to ignore spaces
- Passing in key through `map` function call
- Why is my React Input box not rendering delayed response even though the wrapper class renders the input box - React with Redux
- Why does one function cause component to rerender but the other does not Nextjs?
- How to integrate a Nodejs API with ReactJs app under the same domain
- Watermark on HTML Video with CSS
- GQL doesnt automatically invoke query
- Error: Cannot find module '/app/react-web/react-scripts'
- React : best way to Import / Export
- Dropdown menu in React, filter through list
- React + Redux connect (mapStateToProps)
- How to render new page in React using react-dom-router?
- Fetching methods depends on each other
- How to add fontColor, fontBackgroundColor, fontSize to ckeditor5 in React
- Preflight request doesn't pass access control check: It does not have HTTP ok status