Hello Guys iam Guru a Self thought web developer currently in the phase of learning react js already it take's too much time to me
to understand the basics of react today iam learning about useEffects and i dont even know how to work with api's yeah it sounds like shit!! but yesss i dont know how to work with apis
but i realy have my full focused on my journey to be become a Full Stack web developer its my First Post in Dev Community any Way iam started put more focuse of my carrer from today.
while doing some of the projects i accedently did some simple counter but it only has one button for increse and decrese
i know it was not that much complicated for a medium level react learner or a pro in react but it was helpful in someways for a very new react biggner
here are my code's
import "./styles.css";
import { useState, useEffect } from "react";
export default function App() {
const [count, setCount] = useState(0);
const [isNeg, setIsNeg] = useState(false);
const changeMode = () => {
isNeg ? setCount((count) => count - 1) : setCount((count) => count + 1);
};
return (
<div className="App">
<div>
<h1>{count}</h1>
<button onClick={() => setIsNeg((value) => !value)}>
change
</button>
<button onClick={changeMode}>{isNeg ? "+" : "-"}</button>
</div>
</div>
);
}
yes my English is soo much messy and not perfect but i correct that too and also iam looking for connect with web developers is any one intrested pls replay for this post
Thank You....
Top comments (2)
Hello, and welcome!
When posting code samples, you can specify the type of code to get automatic code highlighting.
Will end up looking like this:
Oh thank you sir ❤️