From 532acf9d860f42ded38720d41bc852cc4711d62d Mon Sep 17 00:00:00 2001 From: Bogdan Bodnar Date: Fri, 17 Jan 2020 12:21:21 +0100 Subject: [PATCH] Add warning about using component in plugins. --- README.md | 17 +++++++++++++++++ src/form/components/ForisForm.js | 7 ++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 79a6dfb..a0f03d1 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,20 @@ tagged `beta`. Versions names are based on commit SHA, e.g. unnecessary version 3. Create a merge request from `dev` to `master` branch 4. New version should be published automatically + +## Manually managed dependencies +Because of `` component it's required to use exposed `ReactRouterDOM` +object from `react-router-dom` library. `ReactRouterDOM` is exposed by +[reForis](https://gitlab.labs.nic.cz/turris/reforis/reforis/blob/master/js/webpack.config.js). +It can be done by following steps: + +1. Setting `react-router-dom` as `peerDependencies` and `devDependencies` in `package.json`. +2. Adding the following rules to `externals` in `webpack.conf.js` of the plugin: + +```js +externals: { + ... + "react-router-dom": "ReactRouterDOM", +} +``` + diff --git a/src/form/components/ForisForm.js b/src/form/components/ForisForm.js index 89c087f..65eff29 100644 --- a/src/form/components/ForisForm.js +++ b/src/form/components/ForisForm.js @@ -73,7 +73,12 @@ ForisForm.defaultProps = { disabled: false, }; -/** Serves as HOC for all foris forms components. */ +/** Serves as HOC for all foris forms components. + * + * As `` from `react-router-dom` is used in this component then it required to + * use exposed `ReactRouterDOM` object from `react-router-dom` library which is exposed by reForis. + * See README for more information. + * */ export function ForisForm({ ws, forisConfig,