Releases: lit/lit
@lit/react@1.0.5
@lit-labs/ssr-react@0.3.0
Minor Changes
-
#4575
aa4fc3ef
- The Node build of@lit-labs/ssr-react/enable-lit-ssr.js
now also monkey-patchesreact/jsx-runtime
to include logic for deeply server-rendering Lit components without modifyingjsxImportSource
in tsconfig.The monkey-patching logic also adds a workaround for inconsistent es module interop behavior in tools like webpack which could lead to errors like
TypeError: Cannot set property createElement of [object Module] which has only a getter
.
Patch Changes
@lit-labs/nextjs@0.2.0
Minor Changes
-
#4575
aa4fc3ef
- Add support for Next.js 14 and App Router. No longer support Next.js 12.Note: By default, components in the App Router are React Server Components (RSCs). Deep SSR of Lit components does not work within server components as they result in React hydration mismatch due to the presence of the
<template>
element in the RSC payload containing the serialized server component tree, and the custom element definitions will not be included with the client bundle either when imported in server component files.Make sure any Lit components you wish to use are beyond the
'use client';
boundary. These will still be server rendered for the initial page load just like they did for the Pages Router.
Patch Changes
lit@3.1.3
lit-html@3.1.3
lit-element@4.0.5
@lit/context@1.1.1
@lit-labs/cli@0.6.4
@lit/react@1.0.4
Patch Changes
-
#4572
5ed30d47
- Fix issue where event handler prop was incorrectly being set on the underlying custom element instance and potentially overriding an existing method/property. -
#4534
d68f5c70
- Wrapped components will now keep track of JSX props from previous render that were set as a property on the element, but are now missing, and set the property toundefined
. Note, wrapped components still do not have "default props" and missing props will be treated the same as explicitly passing inundefined
.This fixes the previously unexpected behavior where the following JSX when first rendered with a truthy condition
return condition ? <WrappedInput disabled /> : <WrappedInput />;
would leave the
disabled
property and reflected attribute to betrue
even when the condition turns falsey.