Open Shariar-Hasan opened 2 years ago
Thanks re..ami try korbo eta korar. But setToggleAddUser , setToggleAllUser die abar value set o korte hbe. Eta kothai korbo..
On Fri, 6 Aug 2021, 12:51 pm Shariar Hasan, @.***> wrote:
IN : ValidationAndAddUser:
const handleAdd=()=>{ document.getElementById("AllUserDiv").style.display="none"; document.getElementById("AddUserDiv").style.display="block"; } const handleUser=()=>{ document.getElementById("AllUserDiv").style.display="block"; document.getElementById("AddUserDiv").style.display="none"; }
instead of this code you can use State variables:
const [toggleAllUser, setToggleAllUser] = useState(false); const [toggleAddUser, setToggleAddUser] = useState(true);
....
...
{toggleAddUser &&
</div>
{toggleAllUser &&
</div>}
then when ever you want to show or not, just toggle the state.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/TasnimJahan/Login-with-JWT-and-store-data/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQL2DFLUOMEQAOUKM5GWVQLT3OA77ANCNFSM5BVJWIEQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .
Shariar-Hasan commented 2 years ago
Ze ze value add korte hobe, sheta props hishebe pass kore dibi othoba othba children hishebe othoba context api othoba stateprops hishebe
IN : ValidationAndAddUser:
instead of this code you can use State variables & conditional rendering:
then when ever you want to show or not, just toggle the state.