Skip to content

Darkmode with SSR support (with cookies) on Reejs Framework

Notifications You must be signed in to change notification settings

ree-js/darkmode-w-ssr

Repository files navigation

Theme Toggle With Reejs

This repo demonstrates how to use Reejs to create a theme toggle with SSR support (with the help of cookies).

Since Reejs exports the Hono context to components during ssr, we can use it to access the cookies and set the theme accordingly. On browser side, we can use the useEffect hook to set the theme based on the cookie value.

Preqrequisites

  • Reejs latest version successfully installed and working.

Usage

  • Clone this repo
  • Run reejs i && reejs sync && npm install to install dependencies
  • Run npm run dev to start the dev server
  • Open localhost:3000 in your browser

If you like this repo, please consider giving it a star ⭐ on reejs framework itself to show your support 💪

About

Darkmode with SSR support (with cookies) on Reejs Framework

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published