Skip to content

Instantly share code, notes, and snippets.

@kylephughes
Created July 27, 2021 13:37
Show Gist options
  • Save kylephughes/c630e5e63a5cc5ee4fc009bbb0e41336 to your computer and use it in GitHub Desktop.
Save kylephughes/c630e5e63a5cc5ee4fc009bbb0e41336 to your computer and use it in GitHub Desktop.
// <Notification/>
import { useSelector } from 'react-redux'
export const Notification = (props) => {
const notification = useSelector((state) => state.notification)
}
// <FormComponent/>
import { useDispatch } from 'react-redux'
export const FormComponent = (props) => {
const dispatch = useDispatch()
const sendNotification = () => {
dispatch({type: 'SET-NOTIFICATION', payload: 'Success' )
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment