-
- {icon === 'labs' && (
-
- )}
- {icon === 'blog' && (
-
- )}
- {date}
- {badge ? (
-
- New
-
- ) : null}
-
-
- {children}
-
- {children != null && (
-
- Read more
-
+
+
+
+
+ {title}
+
+
+
+
+ {icon === 'labs' && (
+
)}
+ {icon === 'blog' && (
+
+ )}
+ {date}
+ {badge ? (
+
+ New
+
+ ) : null}
+
+ {children}
+
+ {children != null && (
+
+ Read more
+
+ )}
-
+
);
}
diff --git a/src/components/MDX/Link.tsx b/src/components/MDX/Link.tsx
index 8986d07a5..7bf041e56 100644
--- a/src/components/MDX/Link.tsx
+++ b/src/components/MDX/Link.tsx
@@ -13,7 +13,7 @@ function Link({
className,
children,
...props
-}: JSX.IntrinsicElements['a']) {
+}: React.AnchorHTMLAttributes
) {
const classes =
'inline text-link dark:text-link-dark border-b border-link border-opacity-0 hover:border-opacity-100 duration-100 ease-in transition leading-normal';
const modifiedChildren = Children.toArray(children).map((child: any) => {
@@ -41,11 +41,8 @@ function Link({
{modifiedChildren}
) : (
-
- {/* eslint-disable-next-line jsx-a11y/anchor-has-content */}
-
- {modifiedChildren}
-
+
+ {modifiedChildren}
)}
>
diff --git a/src/components/MDX/Sandpack/DownloadButton.tsx b/src/components/MDX/Sandpack/DownloadButton.tsx
index 4181dbe95..4d206fff8 100644
--- a/src/components/MDX/Sandpack/DownloadButton.tsx
+++ b/src/components/MDX/Sandpack/DownloadButton.tsx
@@ -7,19 +7,22 @@ import {useSandpack} from '@codesandbox/sandpack-react';
import {IconDownload} from '../../Icon/IconDownload';
export interface DownloadButtonProps {}
-let supportsImportMap: boolean | void;
+let supportsImportMap = false;
+
+function subscribe(cb: () => void) {
+ // This shouldn't actually need to update, but this works around
+ // https://github.com/facebook/react/issues/26095
+ let timeout = setTimeout(() => {
+ supportsImportMap =
+ (HTMLScriptElement as any).supports &&
+ (HTMLScriptElement as any).supports('importmap');
+ cb();
+ }, 0);
+ return () => clearTimeout(timeout);
+}
function useSupportsImportMap() {
- function subscribe() {
- // It never updates.
- return () => {};
- }
function getCurrentValue() {
- if (supportsImportMap === undefined) {
- supportsImportMap =
- (HTMLScriptElement as any).supports &&
- (HTMLScriptElement as any).supports('importmap');
- }
return supportsImportMap;
}
function getServerSnapshot() {
diff --git a/src/components/Search.tsx b/src/components/Search.tsx
index 0e8f84f0d..2a9743ec3 100644
--- a/src/components/Search.tsx
+++ b/src/components/Search.tsx
@@ -22,11 +22,7 @@ export interface SearchProps {
}
function Hit({hit, children}: any) {
- return (
-
- {children}
-
- );
+ return {children};
}
// Copy-pasted from @docsearch/react to avoid importing the whole bundle.
diff --git a/src/content/learn/removing-effect-dependencies.md b/src/content/learn/removing-effect-dependencies.md
index dc34eedad..0a5151daa 100644
--- a/src/content/learn/removing-effect-dependencies.md
+++ b/src/content/learn/removing-effect-dependencies.md
@@ -882,7 +882,7 @@ const options2 = { serverUrl: 'https://localhost:1234', roomId: 'music' };
// These are two different objects!
console.log(Object.is(options1, options2)); // false
-````
+```
**Object and function dependencies can make your Effect re-synchronize more often than you need.**
@@ -968,7 +968,7 @@ const roomId2 = 'music';
// These two strings are the same!
console.log(Object.is(roomId1, roomId2)); // true
-````
+```
Thanks to this fix, the chat no longer re-connects if you edit the input:
diff --git a/src/content/learn/responding-to-events.md b/src/content/learn/responding-to-events.md
index 4e491bc86..1238e9bfa 100644
--- a/src/content/learn/responding-to-events.md
+++ b/src/content/learn/responding-to-events.md
@@ -65,7 +65,7 @@ button { margin-right: 10px; }
Hai definito la funzione `handleClick` e poi l'hai [passata come prop](/learn/passing-props-to-a-component) al tag `