As we are using typescript first set the type of arguments
type authContextType = { user: boolean; login: () => void; logout: (someParameter: any) => void; };
then pass make use of your properties
const logout = (someParameter: any) => { // use of your parameters setUser(false); };
And finally pass it to the function, where you are using it.
... <div> <button onClick={login}>Login</button> <button onClick={() => logout(someProperty)}>Logout</button> </div> ...
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
As we are using typescript first set the type of arguments
then pass make use of your properties
And finally pass it to the function, where you are using it.