[READ-ONLY] Mirror of https://github.com/danielroe/nuxt-pre-hydrate.
0

Configure Feed

Select the types of activity you want to include in your feed.

92 8 1

Clone this repository

https://git.vm.fail/danielroe.dev/nuxt-pre-hydrate https://git.vm.fail/did:plc:sghyi4ee64hm2qnaezle7kho
ssh://git@knot1.tangled.sh:2222/danielroe.dev/nuxt-pre-hydrate ssh://git@knot1.tangled.sh:2222/did:plc:sghyi4ee64hm2qnaezle7kho

For self-hosted knots, clone URLs may differ based on your setup.


README.md

Nuxt Pre-Hydrate#

npm version npm downloads Github Actions Codecov

Safely run pre-hydration steps on the client with Nuxt 3

Features#

  • 💪 Prevents hydration mismatch on client
  • 🏁 Fully configurable
  • ⚠️ Experimental and under developemnt

Installation#

Install and add nuxt-pre-hydrate to your nuxt.config.

# Whichever matches your package manager
pnpm add -D nuxt-pre-hydrate
npm install -D nuxt-pre-hydrate
yarn add -D nuxt-pre-hydrate
export default defineNuxtConfig({
  modules: ['nuxt-pre-hydrate'],
})

Usage#

To use, you can use the <PreHydrate> component anywhere in your app.

<script setup lang="ts">
const contentRenderer = (renderProps) => /* return a string of the HTML meant to be rendered on the client */
</script>

<template>
  <PreHydrate tag="div" :renderContent="contentRenderer" strategy-name="test" v-bind="renderProps">
    {{ contentRenderer() }}
  </PreHydrate>
</template>

💻 Development#

  • Clone this repository
  • Enable Corepack using corepack enable (use npm i -g corepack for Node.js < 16.10)
  • Install dependencies using pnpm install
  • Stub module with pnpm dev:prepare
  • Run pnpm dev to start playground in development mode

License#

Made with ❤️

Published under the MIT License.