Skip to content

Commit 333667a

Browse files
committed
📝 Add how to use setOptions function to README.md
1 parent 01dc206 commit 333667a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,19 @@ use it like so:
528528
ReactUJS.getConstructor = ReactUJS.constructorFromRequireContext(require.context('components', true));
529529
```
530530

531+
### Configure UJS
532+
533+
You can change the behaviours of `ReactRailsUJS` by calling `setOptions(options)` function:
534+
535+
```js
536+
ReactRailsUJS.setOptions({ replaceNull: false });
537+
```
538+
539+
Current acceptable options are the following:
540+
541+
| Key | Value type | Description | Default |
542+
| --- | ---------- | ----------- | ------- |
543+
| `replaceNull` | boolean (`true` / `false`) | Whether to replace all `null`s in the props from Rails (originally `nil` in Rails) with `undefined`. May be helpful when defining the types of the props in TypeScript. See [discussion#1272](https://github.com/reactjs/react-rails/discussions/1272). | `false`|
531544

532545
## Server-Side Rendering
533546

0 commit comments

Comments
 (0)