Как реализовать компонент WillMount в приложении реакции электрода Walmart?
Я пытаюсь начать работу с платформой приложения реакции электрода Walamart и не знаю, как добавить поведение при монтировании приложения. Я хочу настроить аутентификацию приложения, используя auth0.lock, и хочу реализовать инициализацию в приложении componentDidMount
функция.
http://www.electrode.io/docs/whats_inside.html
Как я могу добавить его в файл app.jsx? Это правильное место для этого? Ожидает ли window.webappStart реагирующий компонент для возврата?
//
// This is the client side entry point for the React app.
//
import React from 'react';
import { render } from 'react-dom';
import { Router } from 'react-router';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import { routes } from './routes';
import rootReducer from './reducers';
import './styles/base.css';
//
// Add the client app start up code to a function as window.webappStart.
// The webapp's full HTML will check and call it once the js-content
// DOM is created.
//
window.webappStart = () => {
const initialState = window.__PRELOADED_STATE__;
const store = createStore(rootReducer, initialState);
render(
<Provider store={store}>
<Router>{routes}</Router>
</Provider>,
document.querySelector('.js-content')
);
};