Skip to content

Instantly share code, notes, and snippets.

@rishichawda rishichawda/ChildComponent.js Secret
Created May 19, 2019

Embed
What would you like to do?
ChildComponent.js with useContext - Managing Application State without Redux
import React from 'react'
import { context } from './redux';
const ChildComponent = () => {
const state = React.useContext(context);
return (
<div>
<p>This is the child component.</p>
<p>{state.count}</p>
</div>
);
}
export default ChildComponent;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.