How to use the react-redux.Provider.childContextTypes function in react-redux

To help you get started, we’ve selected a few react-redux examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hisschemoller / volca-freesound / src / components / App.js View on Github external
import React from 'react';
import PropTypes from 'prop-types';
import { Provider as ReduxProvider } from 'react-redux';

const ContextType = {
  // Enables critical path CSS rendering
  // https://github.com/kriasoft/isomorphic-style-loader
  insertCss: PropTypes.func.isRequired,
  // Universal HTTP client
  fetch: PropTypes.func.isRequired,
  pathname: PropTypes.string.isRequired,
  query: PropTypes.object,
  // Integrate Redux
  // http://redux.js.org/docs/basics/UsageWithReact.html
  ...ReduxProvider.childContextTypes,
};

/**
 * The top-level React component setting context (global) variables
 * that can be accessed from all the child components.
 *
 * https://facebook.github.io/react/docs/context.html
 *
 * Usage example:
 *
 *   const context = {
 *     history: createBrowserHistory(),
 *     store: createStore(),
 *   };
 *
 *   ReactDOM.render(
github flatlogic / react-dashboard / src / components / App.js View on Github external
import LoginComponent from '../pages/login/Login';

// import { auth } from '../config';

const RegisterBundle = Bundle.generateBundle(loadRegister);
const NotFoundBundle = Bundle.generateBundle(loadNotFound);

const ContextType = {
  // Enables critical path CSS rendering
  // https://github.com/kriasoft/isomorphic-style-loader
  insertCss: PropTypes.func.isRequired,
  // Universal HTTP client
  fetch: PropTypes.func.isRequired,
  // Integrate Redux
  // http://redux.js.org/docs/basics/UsageWithReact.html
  ...ReduxProvider.childContextTypes,
};

/* eslint-disable */
const PrivateRoute = ({ component, isAuthenticated, ...rest }) =>
  
      isAuthenticated
        ? React.createElement(component, props)
        : }
  />;
github elmadev / elmaonline-site / src / components / App.js View on Github external
import { Provider as ReduxProvider } from 'react-redux';
import { ApolloProvider } from 'react-apollo';

const ContextType = {
  // Enables critical path CSS rendering
  // https://github.com/kriasoft/isomorphic-style-loader
  insertCss: PropTypes.func.isRequired,
  // Universal HTTP client
  fetch: PropTypes.func.isRequired,
  pathname: PropTypes.string.isRequired,
  store: PropTypes.object.isRequired,
  storeSubscription: PropTypes.object,
  query: PropTypes.object,
  // Integrate Redux
  // http://redux.js.org/docs/basics/UsageWithReact.html
  ...ReduxProvider.childContextTypes,
  // Apollo Client
  client: PropTypes.object.isRequired,
};

/**
 * The top-level React component setting context (global) variables
 * that can be accessed from all the child components.
 *
 * https://facebook.github.io/react/docs/context.html
 *
 * Usage example:
 *
 *   const context = {
 *     history: createBrowserHistory(),
 *     store: createStore(),
 *   };
github kristjanmik / kjosturett-web / src / components / App.js View on Github external
* LICENSE.txt file in the root directory of this source tree.
 */

import React from 'react';
import PropTypes from 'prop-types';
import { Provider as ReduxProvider } from 'react-redux';

const ContextType = {
  // Enables critical path CSS rendering
  // https://github.com/kriasoft/isomorphic-style-loader
  insertCss: PropTypes.func.isRequired,
  // Universal HTTP client
  fetch: PropTypes.func.isRequired,
  // Integrate Redux
  // http://redux.js.org/docs/basics/UsageWithReact.html
  ...ReduxProvider.childContextTypes,
};

/**
 * The top-level React component setting context (global) variables
 * that can be accessed from all the child components.
 *
 * https://facebook.github.io/react/docs/context.html
 *
 * Usage example:
 *
 *   const context = {
 *     history: createBrowserHistory(),
 *     store: createStore(),
 *   };
 *
 *   ReactDOM.render(
github alphalion-tool / react-crm-kit / test / helpers / enzyme.js View on Github external
export function mountEnv(node, store) {
    const intl = intlProvider.getChildContext().intl;
    return mount(React.cloneElement(node, { intl, store }),
        {
            childContextTypes: Object.assign({}, { intl: intlShape }, { router: shape({}) }, permissionContextTypes, Provider.childContextTypes),
            context: Object.assign({}, mockPermission(), { store }, { intl }, { router }),
        }
    )
}
github CodeHubOrg / organisations-database / test / containers / App.spec.js View on Github external
const  initialState ={ 
    items: [
      {
        id: 1,
        name: 'Javascript 101',
        selected: false
      },
      {
        id: 2,
        name: 'CodeHub Bristol',
        selected: false
      }
    ]}

  const store = createStore(function (state = initialState){return state});
  Provider.childContextTypes = {
    store: React.PropTypes.object
  };

  const component = mount(
    
      
    
  )

  return {
    component: component
  }
}