mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2024-12-24 00:01:36 +01:00
Add warning about using <ForisForm /> component in plugins.
This commit is contained in:
parent
e7e389e843
commit
532acf9d86
17
README.md
17
README.md
|
@ -16,3 +16,20 @@ tagged `beta`. Versions names are based on commit SHA, e.g.
|
||||||
unnecessary version
|
unnecessary version
|
||||||
3. Create a merge request from `dev` to `master` branch
|
3. Create a merge request from `dev` to `master` branch
|
||||||
4. New version should be published automatically
|
4. New version should be published automatically
|
||||||
|
|
||||||
|
## Manually managed dependencies
|
||||||
|
Because of `<ForisForm />` 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",
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,12 @@ ForisForm.defaultProps = {
|
||||||
disabled: false,
|
disabled: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Serves as HOC for all foris forms components. */
|
/** Serves as HOC for all foris forms components.
|
||||||
|
*
|
||||||
|
* As `<Prompt />` 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({
|
export function ForisForm({
|
||||||
ws,
|
ws,
|
||||||
forisConfig,
|
forisConfig,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user