@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colisweb/rescript-toolkit",
3
- "version": "4.8.0",
3
+ "version": "4.8.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "clean": "rescript clean",
@@ -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=ReSchemaI18n.default,
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 {