2.1.6 • Published 5 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
5 years ago
2.1.5
5 years ago
2.1.4
5 years ago
2.1.3
5 years ago
2.1.2
5 years ago
2.1.1
6 years ago
2.1.0
6 years ago
2.0.1
6 years ago
2.0.0
6 years ago
1.0.11
6 years ago
1.0.10
6 years ago
1.0.9
6 years ago
1.0.8
6 years ago
1.0.7
6 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago