create react app with redux and router code example

Example 1: create-react-app redux

Copynpx create-react-app my-app --template redux

Example 2: can i use redux connect without react

import store from './store';

export function getProtectedThing() {
  // grab current state
  const state = store.getState();

  // get the JWT token out of it
  // (obviously depends on how your store is structured)
  const authToken = state.currentUser.token;

  // Pass the token to the server
  return fetch('/user/thing', {
    method: 'GET',
    headers: {
      Authorization: `Bearer ${authToken}`
    }
  }).then(res => res.json());
}