diff --git a/package-lock.json b/package-lock.json index d16293ff..704e14fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6602,7 +6602,7 @@ }, "packages/fastui": { "name": "@pydantic/fastui", - "version": "0.0.7", + "version": "0.0.8", "license": "MIT", "dependencies": { "react": "^18.2.0", @@ -6618,7 +6618,7 @@ }, "packages/fastui-bootstrap": { "name": "@pydantic/fastui-bootstrap", - "version": "0.0.7", + "version": "0.0.8", "license": "MIT", "dependencies": { "bootstrap": "^5.3.2", @@ -6628,12 +6628,12 @@ "sass": "^1.69.5" }, "peerDependencies": { - "@pydantic/fastui": "0.0.7" + "@pydantic/fastui": "0.0.8" } }, "packages/fastui-prebuilt": { "name": "@pydantic/fastui-prebuilt", - "version": "0.0.7", + "version": "0.0.8", "license": "MIT", "devDependencies": { "@vitejs/plugin-react-swc": "^3.3.2", diff --git a/packages/fastui-bootstrap/package.json b/packages/fastui-bootstrap/package.json index e84d05ee..deaf99f1 100644 --- a/packages/fastui-bootstrap/package.json +++ b/packages/fastui-bootstrap/package.json @@ -1,6 +1,6 @@ { "name": "@pydantic/fastui-bootstrap", - "version": "0.0.7", + "version": "0.0.8", "description": "Boostrap renderer for FastUI", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -29,6 +29,6 @@ "sass": "^1.69.5" }, "peerDependencies": { - "@pydantic/fastui": "0.0.7" + "@pydantic/fastui": "0.0.8" } } diff --git a/packages/fastui-prebuilt/package.json b/packages/fastui-prebuilt/package.json index 0a1cd08a..2f35e9b3 100644 --- a/packages/fastui-prebuilt/package.json +++ b/packages/fastui-prebuilt/package.json @@ -1,6 +1,6 @@ { "name": "@pydantic/fastui-prebuilt", - "version": "0.0.7", + "version": "0.0.8", "description": "Pre-built files for FastUI", "main": "dist/index.html", "type": "module", diff --git a/packages/fastui/package.json b/packages/fastui/package.json index a0ff596c..23bc35d9 100644 --- a/packages/fastui/package.json +++ b/packages/fastui/package.json @@ -1,6 +1,6 @@ { "name": "@pydantic/fastui", - "version": "0.0.7", + "version": "0.0.8", "description": "Build better UIs faster.", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/fastui/src/components/ServerLoad.tsx b/packages/fastui/src/components/ServerLoad.tsx index 94a87927..1d53186f 100644 --- a/packages/fastui/src/components/ServerLoad.tsx +++ b/packages/fastui/src/components/ServerLoad.tsx @@ -6,6 +6,7 @@ import { DefaultSpinner, DefaultNotFound, DefaultTransition } from '../Defaults' import { ConfigContext } from '../hooks/config' import { PageEvent, usePageEventListen } from '../events' import { EventContextProvider, useEventContext } from '../hooks/eventContext' +import { LocationContext } from '../hooks/locationContext' import { AnyCompList, FastProps } from './index' @@ -51,6 +52,7 @@ export const ServerLoadFetch: FC<{ path: string; devReload?: number }> = ({ path const [componentProps, setComponentProps] = useState(null) const [notFoundUrl, setNotFoundUrl] = useState(undefined) + const { fullPath } = useContext(LocationContext) const url = useServerUrl(path) const request = useRequest() @@ -71,6 +73,10 @@ export const ServerLoadFetch: FC<{ path: string; devReload?: number }> = ({ path } }, [url, request, devReload]) + useEffect(() => { + setNotFoundUrl(undefined) + }, [fullPath]) + return } diff --git a/python/fastui/__init__.py b/python/fastui/__init__.py index fb9c0814..1ce804eb 100644 --- a/python/fastui/__init__.py +++ b/python/fastui/__init__.py @@ -14,7 +14,7 @@ class FastUI(pydantic.RootModel): root: list[AnyComponent] -_PREBUILT_VERSION = '0.0.7' +_PREBUILT_VERSION = '0.0.8' _PREBUILT_CDN_URL = f'https://cdn.jsdelivr.net/npm/@pydantic/fastui-prebuilt@{_PREBUILT_VERSION}/dist/assets'