Skip to content

Instantly share code, notes, and snippets.

View brenonovelli's full-sized avatar
🤘

Breno Novelli brenonovelli

🤘
View GitHub Profile
import React from 'react';
import { useCallback, useDispatch } from 'react-redux';
import { increaseCounterAction } from './actions';
import ExpensiveComponent from './ExpensiveComponent';
// normal way
const Component = props => {
const dispatch = useDispatch();
return (
<button onClick={() => dispatch(increaseCounterAction())}>