Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ilc-adapter-react

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ilc-adapter-react

A single spa plugin for React apps

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3K
decreased by-46.7%
Maintainers
2
Weekly downloads
 
Created
Source

ilc-adapter-react

Adapter for React applications that are registered as either ILC applications or ILC/single-spa parcels.

Implements pretty much the same functionality as single-spa-react. With the following differences:

  • SSR optimized. Automatically decides whenever we need to use ReactDOM.hydrate or ReactDOM.render
  • 100% typed, provides advanced Typescript types
  • Provides complete ILC integration out of the box. This includes: better error handling.
  • Still, single-spa compatible.

Examples of usage

ILC application export:

import ilcAdapterReact, { AppLifecycleFnProps } from 'ilc-adapter-react';
import Root from './root.component';

export default ilcAdapterReact<AppLifecycleFnProps>({
    rootComponent: Root,
});

ILC Parcel export:

import ilcAdapterReact, { ParcelLifecycleFnProps } from 'ilc-adapter-react';
import Root from './root.component';

export default {
    ...ilcAdapterReact<AppLifecycleFnProps>({
        rootComponent: Root,
    }),
    parcels: {
        person: ilcAdapterReact<ParcelLifecycleFnProps>({
            loadRootComponent: () => import('./person.parcel.js').then(property('default')),
        }),
    },
};
// person.parcel.js
import React from 'react';
import { ParcelLifecycleFnProps } from 'ilc-adapter-react';

export default (props: ParcelLifecycleFnProps) => {
    return <div>Hello world</div>;
};

ILC Parcel usage:

import Parcel from 'ilc-adapter-react/parcel';

export default () => (
    <div>
        <Parcel
            loadingConfig={{ appName: '@portal/people', parcelName: 'person' }}
            wrapWith="div"
            customParam1="testProp"
        />
    </div>
);

Keywords

FAQs

Package last updated on 30 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc