@packlify/client
v1.0.0
Published
The `@packlify/client` module is a part of the Packlify Web SDK, designed to facilitate React hydration and client-side setups.
Downloads
2
Readme
@packlify/client
The @packlify/client
module is a part of the Packlify Web SDK, designed to facilitate React hydration and client-side setups.
Table of Contents
Installation
You can add this package to your project using npm:
npm install @packlify/client
Features
This package provides:
- A
hydrate
function to simplify client-side hydration for React apps - Built-in support for
react-router-dom
- Command-line tools for building React code
Usage
JavaScript/TypeScript
To use the hydrate
function in your React app:
import { hydrate } from '@packlify/client';
// Your main component
import App from './App';
// Use the hydrate function
hydrate(App);
// Use it with React Router
hydrate(App, true);
Bin Files
The package comes with two command-line tools:
packlify-build-ssr
: Builds server-side React codepacklify-build-client
: Builds client-side React code
Run the following to execute:
npx packlify-build-ssr
npx packlify-build-client
Requirements
- Node.js
- React 18.2.0 or higher
- react-router-dom 6.15.0 or higher
Contact
Lucas Farias [email protected] LinkedIn - GitHub