jodhman / react-eyedrop

Seamlessly integrate a static typed, fully-tested color-picking React component/hook!
24 stars 11 forks source link

Usage examples #54

Open ryancwalsh opened 1 year ago

ryancwalsh commented 1 year ago

Thanks so much for offering this library!

I was wondering if you could link to a working demo, maybe at Codesandbox or somewhere.

From the Readme, I haven't been able to figure out how to get this working.

If I use <EyeDropper pickRadius={1} onChange={onChange} /> and

function onChange({ rgb, hex }) {
    console.log({ hex });
  }

Then I just see a black oval, and clicking it just logs hex: '#000000' but never opens an eyedropper.

Thanks.

ryancwalsh commented 1 year ago

Ahh, I found your example at https://github.com/jodhman/react-eyedrop/blob/c4e5f64aa3874c430d5be520251f9b21caf4c472/example/src/App.tsx#L5 which was helpful.

It would probably still be nice to have a more prominent live demo linked from the Readme.

But for me, I've got it working now. I appreciate it!

jodhman commented 1 year ago

Hello @ryancwalsh! I'm pleased to see you managed to make it work. I'll take your suggestion to heart and will add a CodeSandbox link to the README. :raised_hands: