use-debugger-hooks icon indicating copy to clipboard operation
use-debugger-hooks copied to clipboard

Potential next version change

Open kyleshevlin opened this issue 1 year ago • 0 comments

Recently, it dawned on me that a nicer API might be the following:

  • rename the hooks to match React's exactly
  • import the package with a namespace

If the hook names match and we import with a namespace, then it's a one name replacement to swap them, like so:

import React from 'react'
import * as debug from 'use-debugger-hooks'

function MyComponent({ someProp }) {
  const myCallback = debug.useCallback(() => {
    someProp()
  }, [someProp])
  
  return // ... some jsx
}

This would make the experience even simpler.

kyleshevlin avatar Jun 12 '23 16:06 kyleshevlin