2.1.6 • Published 4 years ago
react-ssi-fragment v2.1.6
React SSI Fragment
React component for rendering Server Side Includes. For using with MicroFrontend services (or really anything that returns html
).
Installation
With NPM
npm install --save react-ssi-fragment
With Yarn
yarn add react-ssi-fragment
Usage
The component is meant to be used alongside Server Side Rendering (SSR from now on). As such, it's usage looks like this:
On the Server
import { SSIFragment } from 'react-ssi-fragment';
const Component = () => (
<SSIFragment
id="container-id"
url="https://example-micro-frontend.com/microfrontend"
isOnClient={false}
/>
)
On the Client
import { SSIFragment } from 'react-ssi-fragment';
const Component = () => (
<SSIFragment
id="container-id"
url="https://example-micro-frontend.com/microfrontend"
isOnClient={true}
/>
)
Class Component
If for any reason you need a class component and not the hook based implementation, you can use import { SSIFragmentClass } from 'react-ssi-fragment/lib/SSIFragmentClass'
Usage with Typescript
The components interface is typed.
2.1.6
4 years ago
2.1.5
4 years ago
2.1.4
4 years ago
2.1.3
4 years ago
2.1.2
4 years ago
2.1.1
4 years ago
2.1.0
4 years ago
2.0.1
5 years ago
2.0.0
5 years ago
1.0.11
5 years ago
1.0.10
5 years ago
1.0.9
5 years ago
1.0.8
5 years ago
1.0.7
5 years ago
1.0.6
5 years ago
1.0.5
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago