Skip to content

Instantly share code, notes, and snippets.

import * as React from 'react';
import { render } from 'react-native-testing-library';
import { Provider } from 'react-redux';
import { createStore } from 'redux';
import { MyContainerComponent, MyPresentationalComponent } from '...';
// Create a real redux store, with your reducers and middleware, and a useful initial
// state tree...
const store = createStore(...);
render() {
return <MyPureComponent array={[1,2,3]} object={{a:true}} function={() => {}} />;
}
const getAllFooNames1 = createSelector(
stateTree => stateTree,
stateTree => {
return stateTree.allFoos.map(foo => foo.name);
});
const getAllFooNames2 = createSelector(
stateTree => stateTree.allFoos,
allFoos => {
return allFoos.map(foo => foo.name);