Next.js Example
Craft your next amazing library using
react18-global-storer18gsHarness the full potential of React 18 Server Components!import useRGS from "r18gs"; const MY_KEY = "counter"; export const CounterController = () => { const [counter, setCounter] = useRGS(MY_KEY, 0); return ( <input type="number" value={counter} onChange={e => setCounter(Number(e.target.value)) } /> ); }; export const CounterDisplay = () => { const [counter] = useRGS(MY_KEY, 0); return <div>{counter}</div>; };
All components below share the same state without any wrapper.
Counter Controller 1
Counter Display 1
Counter Controller 2
Counter Display 2
Featured packages built with this template.
React18 Loaders ->
A comprehensive library providing customizable loading animation components and a fullscreen loader container, seamlessly integrating with React and Next.js.
Nextjs-Darkmode ->
Unleash the Power of React Server Components! Use dark/light mode on your site with confidence, without losing any advantages of React Server Components
Nextjs-Themes ->
🤟 👉 Theme with confidence and Unleash the Power of React Server Components
React 18 Themes ->
🤟 👉 Unleash the Power of React Server Components
Docs ->
Check out the official documentation for more information.
More Examples ->
Check out more examples on the official GitHub Repo. Feel free to suggest additional examples in the discussions section.
Star this repo ->
Star this repo for your new library! This also motivates us and helps us understand that community is interested in this work.