Skip to content
This repository was archived by the owner on Sep 12, 2020. It is now read-only.
This repository was archived by the owner on Sep 12, 2020. It is now read-only.

How are you accessing localStorage? #39

@dschinkel

Description

@dschinkel

Josh, I cloned this down. How are you getting access to localStorage? Is that from phantom? When I try that in my react project I get undefined so figure it's gotta be phantom (or I could use casper probably):

import 'babel-core/polyfill';
import React from 'react';
import ReactDOM from 'react-dom';
import Root from './containers/Root';
import configureStore from './store/configureStore';
import {loginUserSuccess} from './actions';

const target = document.getElementById('root');
const store = configureStore(window.__INITIAL_STATE__);

const node = (
    <Root store={store} />
);

let token = localStorage.getItem('token');
if (token !== null) {
    store.dispatch(loginUserSuccess(token));
}

ReactDOM.render(node, target);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions