frintjs / frintjs/frint

Proposal: MountApp component

Open
#433 0 comments 1 reaction 0 assignees View on GitHub
help wanted proposal
Dominant language
JavaScript
Stars
756
Forks
33
PR merge metrics
No merged PRs in 30d

Description

## Currently

We use `getMountableComponent(app)` function, to get a component which has the `app` inside React's context.

## Proposal

We can have a `MountApp` component, with usage like:

```js
import { MountApp } from 'frint-react';

const fooApp; // instance

function BarComponent() {
// render a given app with instance
return ;

// render a given app by name
return

// render any component against an app
return }
/>;
}
```

## Further usage

In `frint-react`: The `MountApp` component can then be used by `Region` component and `render` function internally too.

`getMountableComponent` can be deprecated.

## Benefits

We don't have to depend on placing a Region with a name to mount an app somewhere. We can benefit from directly rendering an App somewhere without expecting any other App to share that region.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.