score:0
how do i retrieve what is in the store? lets say after updating my component, how can i retrieve the value inside the component and to post it?
if you want to see how is store change, you can add redux-logger to middleware to see that. when store change, it's likely a props change, you can handle this in function componentdidupdate.
how can i know what changed in my dropdown list and to retrieve it?
values in dropdown is controlled by "const products = state.productsreducer.items;", productsreducer is controlled by actions you passed in dispatch like this: "this.props.dispatch(fetchproducts());".
i think you should add redux-logger to know more how to redux work, it show on console step by step. it will help you learn faster than you think :d
score:0
to retrieve it you forgot the selecteditems
const mapstatetoprops = state => {
const products = state.productsreducer.items;
const loading = state.productsreducer.loading;
const error = state.productsreducer.error;
const selecteditems = state.prodcuts.selecteditems;
return {
products,
loading,
error,
selecteditems
};
};
to change it you should connect another function like
const mapdispatchtoprops = dispatch => {
return {
onchangedropdownselection: (selected)=> dispatch(actions.setselecteddropdown(selected))
}
}
score:1
you will need to pass your action handlers to connect function
connect(mapstatetoprops,{actions})(productlist).
Source: stackoverflow.com
Related Query
- Redux - How to get data from store and post it
- How can I cache data that I already requested and access it from the store using React and Redux Toolkit
- How to fetch data in getInitialProps with redux-saga.Then get the response from redux store while in the getInitialProps method?
- How to retrieve data from Redux store using functional components and avoiding useSelector & useDispatch
- How to get the data from Redux store using class components in React
- How can I get and store Data from Textfield in Form Container?
- How to get a single data element from the database with Redux and React?
- How to get request data from axios.get to Redux store
- react: how to get data from redux store in a rendered component?
- How to update redux store tree and then update another tree with data from first?
- Javascript Redux - how to get an element from store by id
- React Native: HeadslessJS and Redux - How to access store from task
- How to get data from local json file using actions and axios.get() (Redux)?
- How to use useEffect hook properly with array dependency. I passed state from redux store and still my component renders infinitely
- How to get CSV data using Reactjs and store into state?
- How can i get array of object from this data for state and count in reactjs
- How to retrieve data from the server using fetch get method and show it in a table
- Get data from Redux Store after data has been added
- How to take input value from submit form and store in redux store variable?
- How do I pass the text data from firestore inside the expandable row and get the document ID to be passed inside the setState?
- How do I save my data from my POST request, as a variable, to use in my GET request?
- Cannot get data out from redux store
- How get data from the state and edit the element in the form?
- How to get updated state from Redux store using redux-toolkit after component has already rendered?
- How can I get more than one value from the Redux store in a single statement?
- How to get React to re fetch my data from API after a POST or DELETE to Database?
- React with Redux Saga - How to get data back from axios call
- How do I stop state store data from accumulating in a redux component every time I navigate to it using react router
- How to get data from axios call in redux action? React JS search project
- How to pass variable to graphql from method when onClick with button and get it's return data back?
More Query from same tag
- How to replace/inject html tags in a text in node?
- fullscreen divs when clicked
- Potree/Three.js - Where can I find the real time camera (active camera) position coordinates?
- Count of Component in the page conceptual recursive problem
- Importing JavaScript to TypeScript app with Lerna
- Can't auto-complete the React component tag using tab in vscode?
- How to store React local state to Redux global store (HOOKS)
- how to make video autoplay when page loads bydefault?
- updating a prop when another prop is received in mapStateToProps
- How to run reaction callback on every possible change in MobX?
- Calling one async function inside another in redux-thunk
- Parsing error: Unexpected reserved word 'static'
- Does React make any guarantees that the `props` object reference stays stable?
- Properly installed tailwind dosn't work in React app
- Uncaught Error: You must either pass handleSubmit() an onSubmit function or pass onSubmit as a prop
- Updating model value onChange in Meteor + React places cursor at the end of the string
- React Js: Not able to reset nested state
- Object clone in react
- Create helper function for a (click handler) function to reuse in multiple React components
- Vertical Scroll bar goes away after razorpay payment window is closed in react-app
- How to import external data fetch api into react componentDidMount method
- Return matching item from within nested array of objects
- No trailing slash on React not being handled
- react material ui grow on left side
- Change document.body, modify React state and change body again
- Typescript React event handler types
- How to cancel http request in react-redux epic
- How to call external function which return the json and call from react another component?
- React Browser Router v6 not rendering element on refresh
- How to place three elements next to each other using css and centered