From f929e5156cb1941beb2f5329e7b9b8fae4c7691b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Oliva?= Date: Wed, 17 May 2023 10:50:12 -0600 Subject: Modified to be minimal. --- src/features/counter/Counter.jsx | 63 ++++++++-------------------------------- 1 file changed, 12 insertions(+), 51 deletions(-) (limited to 'src/features/counter/Counter.jsx') diff --git a/src/features/counter/Counter.jsx b/src/features/counter/Counter.jsx index 37d866d..d589bf9 100644 --- a/src/features/counter/Counter.jsx +++ b/src/features/counter/Counter.jsx @@ -1,67 +1,28 @@ -import React, { useState } from "react"; -import { useSelector, useDispatch } from "react-redux"; -import { - decrement, - increment, - incrementByAmount, - incrementAsync, - incrementIfOdd, - selectCount, -} from "./counterSlice"; -import styles from "./Counter.module.css"; +import React from 'react' +import { useSelector, useDispatch } from 'react-redux' +import { decrement, increment } from './counterSlice' export function Counter() { - const count = useSelector(selectCount); - const dispatch = useDispatch(); - const [incrementAmount, setIncrementAmount] = useState("2"); - - const incrementValue = Number(incrementAmount) || 0; + const count = useSelector((state) => state.counter.value) + const dispatch = useDispatch() return (
-
- - {count} +
-
-
- setIncrementAmount(e.target.value)} - /> + {count} - -
- ); + ) } -- cgit v1.2.3