All Projects → entria → react-app-loader

entria / react-app-loader

Licence: MIT license
Production ready library for handling Microfrontends

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to react-app-loader

react-drip-form
☕ HoC based React forms state manager, Support for validation and normalization.
Stars: ✭ 66 (-12%)
Mutual labels:  higher-order-component, hoc
Incompose
A inferno utility belt for function components and higher-order components
Stars: ✭ 76 (+1.33%)
Mutual labels:  higher-order-component, hoc
addhoc
Handy little helper to create proper React HOC functions complete with hoisted statics and forwarded refs
Stars: ✭ 40 (-46.67%)
Mutual labels:  higher-order-component, hoc
rrx
⚛️ Minimal React router using higher order components
Stars: ✭ 69 (-8%)
Mutual labels:  higher-order-component, hoc
Neoform
✅ React form state management and validation
Stars: ✭ 162 (+116%)
Mutual labels:  higher-order-component, hoc
react-animation-frame
A React higher-order component that invokes a callback in a wrapped component via requestAnimationFrame
Stars: ✭ 47 (-37.33%)
Mutual labels:  higher-order-component, hoc
React Bps
🔱 Create breakpoints to your component props
Stars: ✭ 64 (-14.67%)
Mutual labels:  higher-order-component, hoc
react-table-hoc-draggable-columns
ReactTable HOC for draggable columns
Stars: ✭ 27 (-64%)
Mutual labels:  higher-order-component, hoc
Hocs
🍱 Higher-Order Components for React
Stars: ✭ 1,784 (+2278.67%)
Mutual labels:  higher-order-component, hoc
Next Nprogress
Next.js HOC to integrate NProgress inside your app
Stars: ✭ 145 (+93.33%)
Mutual labels:  higher-order-component, hoc
Recompact
⚛ A set of React higher-order components utilities. Drop-in replacement for recompose.
Stars: ✭ 419 (+458.67%)
Mutual labels:  higher-order-component, hoc
React With Direction
Components to provide and consume RTL or LTR direction in React
Stars: ✭ 176 (+134.67%)
Mutual labels:  higher-order-component, hoc
Flagged
Feature Flags for React made easy with hooks, HOC and Render Props
Stars: ✭ 97 (+29.33%)
Mutual labels:  higher-order-component, hoc
React Nprogress
⌛️ A React primitive for building slim progress bars.
Stars: ✭ 173 (+130.67%)
Mutual labels:  higher-order-component, hoc
react-combine-contexts
🚀Use multiple React Contexts without pain.
Stars: ✭ 23 (-69.33%)
Mutual labels:  react-dom, hoc
React Fiber Implement
re-implement react fiber
Stars: ✭ 520 (+593.33%)
Mutual labels:  react-dom
Fast React Render
[DEPRECATED] Use last versions of React and Node.js for better performance
Stars: ✭ 102 (+36%)
Mutual labels:  react-dom
React Tiny Dom
🍙 A minimal implementation of react-dom using react-reconciler
Stars: ✭ 432 (+476%)
Mutual labels:  react-dom
React Ssr Prepass
A custom partial React SSR renderer for prefetching and suspense
Stars: ✭ 411 (+448%)
Mutual labels:  react-dom
Radio Group
845 byte WAI-ARIA 1.1 compliant radio group React component
Stars: ✭ 133 (+77.33%)
Mutual labels:  react-dom

react-app-loader github

Production ready library for handling Microfrontends.

Demo and Example

Preview

How to use

Create a config file for each external app:

$ touch AnyExternalApp.js

Then, wrap it with withAppLoader HOC:

// @flow

import withAppLoader from '@entria/react-app-loader';

const elementId = 'github';
const appUrl = 'https://github.com/';

const AppLoader = withAppLoader({ elementId, appUrl });

export default AppLoader;

Or you can try a more complex way, passing some props:

// @flow

import React from 'react';
import withAppLoader from '@entria/react-app-loader';

const elementId = 'github';
const appUrl = 'https://github.com/';

type Props = {
  externalUrl: string,
};

const AnyExternalApp = (props: Props) => {
  const { externalUrl } = props;
  const AppLoader = withAppLoader({
    elementId,
    appUrl: externalUrl != null && externalUrl.length > 0 ? externalUrl : appUrl
  });
  return <AppLoader />;
};

export default AnyExternalApp;

Import it on your React app:

import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';

import AnyExternalApp from './AnyExternalApp';

class App extends Component {
  render() {
    return (
      <div className="App">
        <AnyExternalApp />
      </div>
    );
  }
}

export default App;

Import babel-polyfill on your index.js

import 'babel-polyfill';

Run \o/

Handling cors during development

On Google Chrome, just install this extension: https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].