connect in react redux code example
Example 1: redux import connect
import { connect } from 'react-redux'
Example 2: can i use redux connect without react
import store from './store';
export function getProtectedThing() {
const state = store.getState();
const authToken = state.currentUser.token;
return fetch('/user/thing', {
method: 'GET',
headers: {
Authorization: `Bearer ${authToken}`
}
}).then(res => res.json());
}
Example 3: redux connect
export default connect(mapState, mapDispatch)(Component)