score:1
the problem is not from usestate, you call
axios.post(
"http://localhost:9000/events/" + props.match.params.id,
seteventcomment
)
the error you get is that the url
"http://localhost:9000/events/" + props.match.params.id
does not exist. i don't know how you are supposed to send the id might be
"http://localhost:9000/events?id=" + props.match.params.id
or something else but that's the issue according to your log :
from browser console. xhr.js:178 post http://localhost:9000/events/5f35e9c686c3a9132b5067b9 404 (not found) error: request failed with status code 404
Source: stackoverflow.com
Related Query
- How to make a API post in React with useState
- How to make react router work with static assets, html5 mode, history API and nested routes?
- How to make a POST request with json content type with Semantic UI API
- With React useState how do you access key values of an array returned from fetch API
- How to use a custom React hook to make a POST or DELETE request with Axios
- How to make infinite scroll work with react and intersection api while lazily fetching data?
- how to convert an array to a array of objects with additional information in react using map when doing a POST api request
- How to make POST request with axios and React State Hook
- How to send react object to rails api with a post fetch request? 406 error
- How to make multiple api end point calls in sequential order with react redux javascript?
- How to Make A second API call based on the value gotten from the first. with React and useEffect hooks
- How to make api call with optional payload in React JS
- How to make count increment with Websocket api using React JS
- How to use callback with useState hook in react
- How to use context api with react router v4?
- How to make a Bootstrap dropdown with React
- How can I make React Portal work with React Hook?
- How should the new context api work with React Native navigator?
- How to prevent race conditions with react useState hook
- React PropTypes - How to make a shape optional with its fields required?
- How do you update Formik initial values with the react context api values after an AJAX request?
- How to mock API calls made within a React component being tested with Jest
- How to test snapshots with Jest and new React lazy 16.6 API
- How to secure my react app api with csurf?
- How to use React Context with useState hook to share state from different components?
- React Native: How to make format card expiration with / using <TextInput/>?
- Post an object with fetch using react js and express API server
- How to make pure, generic React components with immutable data that needs to be transformed
- how can I test if useState hook has been called with jest and react testing library?
- How to make a Semantic UI React grid full screen with different row heights?
More Query from same tag
- React-router: Passing data through routes
- Change props value outsite react and reload component
- How to change React-Hook-Form defaultValue with useEffect()?
- Passing functions through props from parent states in ReactJS
- What's the difference between "super()" and "super(props)" in React when using es6 classes?
- How to insert data into firebase by using react-bootstrap-table insertRow?
- Can't install any package with npm
- Hide or show div element
- Relay was unable to reconcile edges on a connection
- Can I put class base components inside function base components to use react hooks?
- How to render multiple rows for a a only a given column in react using react tables?
- How do I pass components with the Context api?
- How can i get the values of actor names from the below given json. I am able to get rest of the values but not actor names
- UI lags for a few seconds when building a large list in React
- React - token refresh is being executed in wrong order
- How to change object key color in vscode, for React app?
- How to use function parameters/arguments in this.setState
- provided in react-beautiful-dnd library
- how to use one component render many html fragment in reactjs?
- Reactjs How to write the greater than 0 in jsx?
- Change color of selected element - React
- How to create new state for every value in state array
- How to implement simple react js animation with react-pose without node js?
- react type error when fetching new array state
- How to preload images in Gatsby?
- Passing components as state in React (Tab functionality)
- Routing from a react app to get a server side rendered HTML generated from handlebars
- How to send React hook's setter to another component
- How to resolve an error in Typescript about `withStateHandlers`
- html form input method get prevent name in url if value is not filled