gun icon indicating copy to clipboard operation
gun copied to clipboard

Update react

Open konsumer opened this issue 4 months ago • 3 comments

I think the react examples could use an update. I was thinking something like this.

Here are the stuff my demo has:

  • use context to hold gun object
  • use hooks (useGun, and useCallback in examples, but also any other state/effects needed could go here)
  • functional components
  • modern tooling (I am using vite with swc in my example)
  • CI build to github-pages by default

This style can be used for react-native as well as web-react, and makes everything simpler & easier to use.

I am happy to PR anything to modernize it. I noticed docs & examples have old class-components. Is there anywhere else? Where are docs source?

konsumer avatar Aug 05 '25 18:08 konsumer

Oh gosh, yes please, with anything like React it seems they change stuff every 6 months so please please please have at it. Basically anything that actually works & is up to date is always a blessing, since I don't use react myself personally but want as wide ecosystem support.

amark avatar Aug 15 '25 23:08 amark

Oh gosh, yes please, with anything like React it seems they change stuff every 6 months

Yes, agreed. I think the API has stabilized a bit, and now it's mostly very small changes. This style of functional + hooks has gained a lot of traction, and I think will be around for a while.

Where do I start?

I feel like these are the main areas, did I miss any?

konsumer avatar Aug 21 '25 15:08 konsumer

@konsumer sure! https://github.com/amark/gun/wiki/React-Tutorial https://github.com/amark/gun/wiki/React to edit + then PR on the examples/react

amark avatar Dec 01 '25 05:12 amark