@astrojs/react
π Patch Changes
- #15264
11efb05Thanks @florian-lefebvre! - Lower the Node version requirement to allow running on Stackblitz until it supports v22
- #15264
π Patch Changes
-
#14715
3d55c5dThanks @ascorbic! - Adds support for client hydration ingetContainerRenderer()The
getContainerRenderer()function is exported by Astro framework integrations to simplify the process of rendering framework components when using the experimental Container API inside a Vite or Vitest environment. This update adds the client hydration entrypoint to the returned object, enabling client-side interactivity for components rendered using this function. Previously this required users to manually callcontainer.addClientRenderer()with the appropriate client renderer entrypoint.See the
container-with-vitestdemo for a usage example, and the Container API documentation for more information on using framework components with the experimental Container API.
-
π Patch Changes
- #14621
e3175d9Thanks @GameRoMan! - Updatesviteversion to fix CVE
- #14621
πΏ Minor Changes
-
#14386
f75f446Thanks @yanthomasdev! - Stabilizes the formerly experimentalgetActionState()andwithState()functions introduced in@astrojs/reactv3.4.0 used to integrate Astro Actions with React 19βsuseActionState()hook.This example calls a
likeaction that accepts apostIdand returns the number of likes. Pass this action to thewithState()function to apply progressive enhancement info, and apply touseActionState()to track the result:import { actions } from 'astro:actions';import { withState } from '@astrojs/react/actions';import { useActionState } from 'react';export function Like({ postId }: { postId: string }) {const [state, action, pending] = useActionState(withState(actions.like),0, // initial likes);return (<form action={action}><input type="hidden" name="postId" value={postId} /><button disabled={pending}>{state} β€οΈ</button></form>);}You can also access the state stored by
useActionState()from your action handler. CallgetActionState()with the API context, and optionally apply a type to the result:import { defineAction } from 'astro:actions';import { z } from 'astro:schema';import { getActionState } from '@astrojs/react/actions';export const server = {like: defineAction({input: z.object({postId: z.string(),}),handler: async ({ postId }, ctx) => {const currentLikes = getActionState<number>(ctx);// write to databasereturn currentLikes + 1;},}),};If you were previously using this experimental feature, you will need to update your code to use the new stable exports:
src/components/Form.jsx import { actions } from 'astro:actions';import { experimental_withState } from '@astrojs/react/actions';import { withState } from '@astrojs/react/actions';import { useActionState } from "react";src/actions/index.ts import { defineAction, type SafeResult } from 'astro:actions';import { z } from 'astro:schema';import { experimental_getActionState } from '@astrojs/react/actions';import { getActionState } from '@astrojs/react/actions';
-
π Patch Changes
- #14326
c24a8f4Thanks @jsparkdev! - Updatesviteversion to fix CVE
- #14326
πΏ Minor Changes
-
#13809
3c3b492Thanks @ascorbic! - Increases minimum Node.js version to 18.20.8Node.js 18 has now reached end-of-life and should not be used. For now, Astro will continue to support Node.js 18.20.8, which is the final LTS release of Node.js 18, as well as Node.js 20 and Node.js 22 or later. We will drop support for Node.js 18 in a future release, so we recommend upgrading to Node.js 22 as soon as possible. See Astroβs Node.js support policy for more details.
:warning: Important note for users of Cloudflare Pages: The current build image for Cloudflare Pages uses Node.js 18.17.1 by default, which is no longer supported by Astro. If you are using Cloudflare Pages you should override the default Node.js version to Node.js 22. This does not affect users of Cloudflare Workers, which uses Node.js 22 by default.
-
π Patch Changes
- #13731
c3e80c2Thanks @jsparkdev! - update vite to latest version for fixing CVE
- #13731
π Patch Changes
- #13720
e1cd1aeThanks @florian-lefebvre! - Fixes SSR renderer type
- #13720
π Patch Changes
- #13663
a19a185Thanks @florian-lefebvre! - Improves type-safety of renderers
- #13663
π Patch Changes
-
#13596
3752519Thanks @jsparkdev! - update vite to latest version to fix CVE -
#13547
360cb91Thanks @jsparkdev! - Updates vite to the latest version
-
π Patch Changes
- #13526
ff9d69eThanks @jsparkdev! - updateviteto the latest version
- #13526
π Patch Changes
- #13505
a98ae5bThanks @ematipico! - Updates the dependencyviteto the latest.
- #13505
π Patch Changes
- #13323
80926faThanks @ematipico! - Updatesesbuildandviteto the latest to avoid false positives audits warnings caused byesbuild.
- #13323
πΏ Minor Changes
-
#13036
3c90d8fThanks @artmsilva! - Adds experimental support for disabling streamingThis is useful to support libraries that are not compatible with streaming such as some CSS-in-JS libraries. To disable streaming for all React components in your project, set
experimentalDisableStreaming: trueas a configuration option for@astrojs/react:astro.config.mjs import { defineConfig } from 'astro/config';import react from '@astrojs/react';export default defineConfig({integrations: [react({experimentalDisableStreaming: true,}),],});
-
π Patch Changes
π Patch Changes
- #12887
ea603aeThanks @louisescher! - Adds a warning message when multiple JSX-based UI frameworks are being used without either theincludeorexcludeproperty being set on the integration.
- #12887