8000 GitHub - kamleshchandnani/useDebug: Custom hook to debug useEffect
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

kamleshchandnani/useDebug

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation



Custom hook to debug useEffect

Codesandbox demo 🔗

 

Based on Tomasz Łakomy's egghead lesson on hooks

 

install

Uses the useEffect hook from React 16.7+

npm install usedebug

 

usage

import React from "react"
const useDebug = require("usedebug")

function MyComponent() {
  useDebug("mycomponent") // call useDebug with an optional id
  return <div>Hey!</div>
}

Check the console to see logs

__DEBUG_mycomponent__ mounted 
__DEBUG_mycomponent__ unmounted

 

like it?

⭐ this repo

 

license

MIT © siddharthkp

About

Custom hook to debug useEffect

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%
0