Skip to content

Instantly share code, notes, and snippets.

@Sergioamjr
Last active May 22, 2021 15:53
Show Gist options
  • Save Sergioamjr/067a388727ff0b7a5eef62849f6e07b8 to your computer and use it in GitHub Desktop.
Save Sergioamjr/067a388727ff0b7a5eef62849f6e07b8 to your computer and use it in GitHub Desktop.
import { useDebugValue, useState } from "react";
function useUserStatus() {
const [isLogged, setIsLogged] = useState(false);
// ...
// Mostra um `label` no DevTools ao lado desse hook
useDebugValue(isLogged ? "Logged" : "Not logged");
return isLogged;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment