This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { | |
Provider, | |
createStoreHook, | |
createDispatchHook, | |
createSelectorHook | |
} from 'react-redux' | |
const MyContext = React.createContext(null) | |
const MyOtherContext = React.createContext(null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
LoginReducer, | |
CartsReducer | |
} from 'shared-state/lib/Reducers'; | |
import { appSpecificReducer } from './localReducer' | |
const rootReducer = combineReducers({ | |
appSpecificReducer, | |
LoginReducer, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { cleanup, fireEvent, findByText } from '@testing-library/react'; | |
import { renderWithRedux, createReduxStore } from '/testHelpers'; | |
import ProductDetail from './ProductDetail'; | |
import ProductContext from './ProductContext'; | |
describe('Product Details', () => { | |
afterEach(() => { | |
cleanup(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ProductDetail = () => { | |
const classes = useStyles(); | |
const cart = useSelector(state => state.cart); | |
const { product } = useContext(ProductContext); | |
return ( | |
<Card > | |
<CardContent> | |
<Box> | |
{product.name}: {cart.count} |
NewerOlder