I am just curious if there is a way to access the global state in redux from my component without using mapStateToProps
.
Thanks.
you can make use of the useSelector hook from the react-redux library to access the store without mapping it to your props.
you can use:
in the connect function provided by react-redux
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.