Last active
April 20, 2018 16:55
-
-
Save tastycode/f5e2a62b125b73537affcb9659ff386e to your computer and use it in GitHub Desktop.
Dispatching without making an action creator
This file contains hidden or 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
// types.js | |
const REPORTER_PENDING_REPORT_UPDATE = "[reporter] pending report update" | |
// components/PromptHarm.js | |
import types from 'types' | |
const PromptHarm = ({dispatch}) => ( <PromptContainer> | |
<PromptText>Is anyone at risk of immediate harm to themselves or others?</PromptText> | |
<PromptButtonsContainer> | |
<PromptButton onClick={() => dispatch({types: types.REPORTER_PENDING_REPORT_UPDATE})} text="YES"/> | |
<PromptButton text="CANCEL"/> | |
</PromptButtonsContainer> | |
</PromptContainer> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment