Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React from 'react';
import { hydrate } from 'react-dom';
import { Router, browserHistory } from 'react-router';
import routes from '../universal/routes';
import { Provider } from 'react-redux';
import createStore from '../universal/redux/store';
import ldRedux from 'ld-redux';
import flags from '../../flags.json';
const reduxState = window.__INITIAL_STATE__ || undefined;
const store = createStore(reduxState);
ldRedux.init({
clientSideId: '59b2b2596d1a250b1c78baa4',
dispatch: store.dispatch,
flags,
});
hydrate(
,
document.getElementById('reactDiv'),
);
const mapStateToProps = (state) => {
const homeState = state.Home;
const flags = ldRedux.getFlags(state, homeFlags);
return {
...homeState,
...flags,
};
};
import HomeComponent from './homeComponent';
import ldRedux, {ldConnect} from 'ld-redux';
import {homeFlags} from './homeLogic';
const mapStateToProps = (state) => {
const homeState = state.Home;
const flags = ldRedux.getFlags(state, homeFlags);
return {
...homeState,
...flags,
};
};
@connect(mapStateToProps, homeActions)
@ldConnect(homeFlags)
export default class HomeContainer extends Component {
render() {
return ;
}
}
import { combineReducers } from 'redux';
import Home from '../domain/home/homeReducer';
import ldRedux from 'ld-redux';
export default combineReducers({
Home,
LD: ldRedux.reducer(),
});