@inertiajs/react
Advanced tools
+10
-2
@@ -247,3 +247,4 @@ // src/index.ts | ||
| }, [pageProps, keys]); | ||
| if (loaded) { | ||
| const propsAreDefined = useMemo2(() => keys.every((key) => pageProps[key] !== void 0), [keys, pageProps]); | ||
| if (loaded && propsAreDefined) { | ||
| return typeof children === "function" ? children() : children; | ||
@@ -404,3 +405,5 @@ } | ||
| setProgress(null); | ||
| setError(errors2); | ||
| setErrors(errors2); | ||
| setHasErrors(Object.keys(errors2).length > 0); | ||
| validatorRef.current?.setErrors(errors2); | ||
| } | ||
@@ -794,2 +797,7 @@ if (options.onError) { | ||
| const [url, data] = getUrlAndData(submitter); | ||
| const formTarget = submitter?.getAttribute("formtarget"); | ||
| if (formTarget === "_blank" && resolvedMethod === "get") { | ||
| window.open(url, "_blank"); | ||
| return; | ||
| } | ||
| const submitOptions = { | ||
@@ -796,0 +804,0 @@ headers, |
+10
-2
@@ -290,3 +290,4 @@ "use strict"; | ||
| }, [pageProps, keys]); | ||
| if (loaded) { | ||
| const propsAreDefined = (0, import_react8.useMemo)(() => keys.every((key) => pageProps[key] !== void 0), [keys, pageProps]); | ||
| if (loaded && propsAreDefined) { | ||
| return typeof children === "function" ? children() : children; | ||
@@ -423,3 +424,5 @@ } | ||
| setProgress(null); | ||
| setError(errors2); | ||
| setErrors(errors2); | ||
| setHasErrors(Object.keys(errors2).length > 0); | ||
| validatorRef.current?.setErrors(errors2); | ||
| } | ||
@@ -813,2 +816,7 @@ if (options.onError) { | ||
| const [url, data] = getUrlAndData(submitter); | ||
| const formTarget = submitter?.getAttribute("formtarget"); | ||
| if (formTarget === "_blank" && resolvedMethod === "get") { | ||
| window.open(url, "_blank"); | ||
| return; | ||
| } | ||
| const submitOptions = { | ||
@@ -815,0 +823,0 @@ headers, |
+3
-3
| { | ||
| "name": "@inertiajs/react", | ||
| "version": "2.3.11", | ||
| "version": "2.3.12", | ||
| "license": "MIT", | ||
@@ -63,4 +63,4 @@ "description": "The React adapter for Inertia.js", | ||
| "laravel-precognition": "^1.0.0", | ||
| "lodash-es": "^4.17.22", | ||
| "@inertiajs/core": "2.3.11" | ||
| "lodash-es": "^4.17.23", | ||
| "@inertiajs/core": "2.3.12" | ||
| }, | ||
@@ -67,0 +67,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
341528
0.81%3538
0.45%+ Added
- Removed
Updated
Updated