score:1
you can access the current state tree of your application using getstate method inside of your action creator.
export const fetchmovie = text => (dispatch, getstate) => {
console.log(getstate()); // you can see the info about your state tree here
axios.get(`https://api.themoviedb.org/3/movie/${text}?api_key=api_key&append_to_response=videos,credits,recommendations,watch/providers`)
.then(response => dispatch({
type: specific_movie,
payload: response.data.results
}))
.catch(error => console.log(error))
}
Source: stackoverflow.com
Related Query
- Pass state from one reducer to another in Redux
- Pass a state value from redux reducer to another reducer
- Accessing a part of reducer state from one reducer within another reducer
- How can i pass a state from one react route to another react route?
- How to pass state value from one class to another in Reactjs
- Pass state from one component to another in ReactJs
- How can I pass the state from one component to another and how can I modify the state?
- How to pass state from one component to another in React js?
- How can I pass state from one component to set another state?
- React Redux - Pass data from state to another component to display list of results
- How to pass a hook state from one component to another in a axios function?
- How can I pass props from one component to another withour Redux
- Pass state from one component to another
- Pass state from one component to another stateless component
- How to pass a state value from one component to another component at the same level
- How to pass state from one useEffect to another useEffect on intial page load?
- Pass state from one react page to another using history.push
- How to access one component's state from another component
- Accessing a reducer state from within another reducer
- Reactjs - passing state value from one component to another
- Is it possible to call a reducer function from another reducer function (within the same slice) using Redux Toolkit?
- Can we pass setState as props from one component to other and change parent state from child component in React?
- How to pass props from one class to another in React.js
- How to from one component set state another component in react native?
- How to pass data from one component to another in React or React-Redux?
- How to pass params from one screen to another via reactnavigation v5
- How to pass data from one component to another ReactJS
- React-Router: pass props from one component to another using link
- How to pass state in React from one class to another?
- How to pass data from one component to another while using API in reactjs
More Query from same tag
- Integrating Google's <model-viewer> with React/Reagent
- Issue with Cors in React.js localhost and Node Express server
- What does api.cache(true) do in Expo's babel.config.js?
- String and state variable concatenation
- re-render component after post request api react
- Accessing value through material ui ListItemText component
- React testing library, how to get text from element
- Detecting which node is selected within a slate-react text editor
- Why pristine props does not disable button for both Redux-Fields
- sidebar with Reactjs
- Return json object to render method - React.js
- Request fails due to CORS issue with origin from localhost
- How to pass input data back to class component?
- How to show fetched data in input box as a dropdown and handle it?
- getByText fails if I run multiply tests but it works if I run separately
- Spacing between MUI Grid items
- Why does ASP.NET Core 6 MVC Route handler not accept data from axios post request?
- Securing my API to only work with my front-end
- Styling individual routes with React
- Resetting select tag after submit
- Can a custom hook determine which component called it?
- Add and Remove the Component onClick function
- React onClick not propagating event
- How to trigger Material UI Select in Cypress
- Error deploying build on netlify (err: 1)
- Cannot access class property when fetching data in React JS
- Correct path for img on React.js
- Rails-React not working with ES6
- Designinig SASS I want Box layout but not able to get it
- Can you use a styled-component keyframe inline on a component?