score:1
you are accessing the state wrong. your component state is accessible inside this.state
property. ie, the value movieanswer
is available inside the this.state
property.
simply change all your state items to below,
console.log("get set ? ",this.state.movieanswer)
also change this.actoranswer
to,
this.state.actoranswer
also i don't think you need those return statements at the end of fetchpersonfunction
and fetchmoviefunction
functions.
Source: stackoverflow.com
Related Query
- Store JSON in a variable in a REACT Helper component
- Store fetch data in a variable and use entire json as a prop in a react component
- Structuring Normalized JSON response in Redux store and mapping to React component props
- React component not re-render when a store variable is dispatched in redux
- How do I declare and reassign a variable in React Class Component to store a setTimeout reference?
- React component not updating when store state has changed
- React + Flux - should store data be stored in a component state, or props?
- How to pass a state className variable to another component in react
- React Redux Store updating, but component not re-rendering
- What is the necessity of "export default connect" when you are connecting your react component to redux store
- How to pass in an instance variable from a React component to its HOC?
- React Mobx - component not updating after store change
- React Component check is variable is empty
- Converting component state to JSON in React
- Updating the react component state when a global variable changes
- React - load all data from json into component
- Store multiple html elements in variable with React
- React Dev Tools does not show Component Names or State Variable Names
- React Component doesn't rerender after sorting array in store
- How to access the Redux store outside of a component in React
- accessing environment variable from react component
- How to pass props to react component that wrapped in variable
- React Redux - accessing existing store in a helper function
- Dynamic layout of React component from JSON
- Conditionally setting className based on a state variable in a React functional component
- Get HTML in JSON to render as HTML in React Component
- use of variable inside render function of react component
- Use css/scss variable in React component as inline style
- Recursive rendering of React component connected to Redux store
- React - Load JSON and render component
More Query from same tag
- React router dom v6 using useNevigation is not working with redux
- How to add "outside" event listener to Markers in Google Maps (react-google-maps/api)
- Why did user object is undefined in NextAuth session callback?
- Link of react-router-dom is not working in firefox
- Property processes does not exist on type "props | undefined"
- How to configure Office-js excel react add-in to use react-router-dom or alternative solutions?
- How to appropriately migrate from componentWillReceiveProps to getDerivedStateFromProps when 'this' is being used
- get local image path from json in react
- How to force remounting on React components?
- rerender a component after redirect with react router
- how should I re-draw table component with entered value
- styled props color, not working to change movie names
- Unable to display API data on React.js
- Invariant Violation: Invalid hook call. Hooks can only be called inside of the body of a function component
- why my env file with a personal access token is not working in my react app?
- Babel not transpile files from parent dir
- how to redirect new page in react js
- How can I export a variable to another file React
- What happens when we use this.setState() in ReactJS?
- How to reload a component without refreshing the entire page?
- How to start a component in a loop and close it all 3 iterations
- My React function being passed down as props is not being invoked
- How to change text in a <p> tag when hovering a button in ReactJs?
- React function not passing down from functional to functional component
- Is it possible for dynamic data to share one state without updating all of them with same content?
- How to Create a dropdown Button with see more option and on click toggle should not happen in react js?
- Trouble passing data to a child component with hooks
- Search function using filter and hooks
- Random set key is being cached?
- Using webpack magic comments in an typescript (sharepoint modern ui) project