Skip to content

Instantly share code, notes, and snippets.

@jinook929
Created May 31, 2021 03:05
Show Gist options
  • Save jinook929/73f74bf43d584b0b510d8625b9557c65 to your computer and use it in GitHub Desktop.
Save jinook929/73f74bf43d584b0b510d8625b9557c65 to your computer and use it in GitHub Desktop.
React with Hooks, with Redux & React-Redux: Reset.js
import React from 'react'
import '../App.css'
import {resetCount} from '../actions'
import {useDispatch} from 'react-redux'
const Reset = () => {
const dispatch = useDispatch()
return (
<div className="Reset">
<button id="resetBtn" onClick={() => dispatch(resetCount())}>Reset</button>
</div>
)
}
export default Reset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment