@colisweb/rescript-toolkit 4.8.0 → 4.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/form/Reform.res +6 -1
package/package.json
CHANGED
package/src/form/Reform.res
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
open ReactIntl
|
|
2
|
+
|
|
1
3
|
module type Config = {
|
|
2
4
|
type field<'a>
|
|
3
5
|
type state
|
|
@@ -177,10 +179,13 @@ module Make = (Config: Config) => {
|
|
|
177
179
|
~schema=[]: Validation.schema,
|
|
178
180
|
~onSubmit,
|
|
179
181
|
~onSubmitFail=ignore,
|
|
180
|
-
~i18n
|
|
182
|
+
~i18n=?,
|
|
181
183
|
~validationStrategy=OnDemand,
|
|
182
184
|
(),
|
|
183
185
|
) => {
|
|
186
|
+
let intl = useIntl()
|
|
187
|
+
let i18n = i18n->Option.getWithDefault(Toolkit__FormValidationFunctions.i18n(intl))
|
|
188
|
+
|
|
184
189
|
let (state, send) = ReactUpdate.useReducerWithMapState(
|
|
185
190
|
(state, action) => {
|
|
186
191
|
switch action {
|