Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract React specific code into subapp-react module #1485

Merged
merged 20 commits into from
Jan 3, 2020
26 changes: 26 additions & 0 deletions packages/subapp-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,36 @@ const Component = () => {
};
```

## Support for React Router

If you want to use [react-router] in your application, then you need to install the dependencies:

- [react-router] and [react-router-dom]

ie:

```bash
npm i react-router react-router-dom
```

And then set the `useReactRouter` flag to true in your subapp:

```js
import { React, loadSubApp } from "subapp-react";

export default loadSubApp({ name: "MySubapp", Component, useReactRouter: true });
```

## License

Copyright (c) 2016-present, WalmartLabs

Licensed under the [Apache License, Version 2.0].

[apache license, version 2.0]: https://www.apache.org/licenses/LICENSE-2.0
[react-router]: https://www.npmjs.com/package/react-router
[react-router-dom]: https://www.npmjs.com/package/react-router-dom

```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Purposeful code block? I more frequently see --- at the end of the License section.


```