Skip to content

Commit e0ada4e

Browse files
Update documentation links for React Compiler and hooks, improve error handling in forms, and enhance static path generation logic
1 parent 2b0b203 commit e0ada4e

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

src/content/blog/2024/10/21/react-compiler-beta-release.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ After installation you can enable the linter by [adding it to your ESLint config
7676

7777
## Backwards Compatibility {/*backwards-compatibility*/}
7878

79-
React Compiler produces code that depends on runtime APIs added in React 19, but we've since added support for the compiler to also work with React 17 and 18. If you are not on React 19 yet, in the Beta release you can now try out React Compiler by specifying a minimum `target` in your compiler config, and adding `react-compiler-runtime` as a dependency. [You can find docs on this here](/reference/react-compiler/configuration#react-17-18).
79+
React Compiler produces code that depends on runtime APIs added in React 19, but we've since added support for the compiler to also work with React 17 and 18. If you are not on React 19 yet, in the Beta release you can now try out React Compiler by specifying a minimum `target` in your compiler config, and adding `react-compiler-runtime` as a dependency. [You can find docs on this here](/reference/react-compiler/target#targeting-react-17-or-18).
8080

8181
## Using React Compiler in libraries {/*using-react-compiler-in-libraries*/}
8282

@@ -86,7 +86,7 @@ React Compiler can also be used to compile libraries. Because React Compiler nee
8686

8787
Because your code is pre-compiled, users of your library will not need to have the compiler enabled in order to benefit from the automatic memoization applied to your library. If your library targets apps not yet on React 19, specify a minimum `target` and add `react-compiler-runtime` as a direct dependency. The runtime package will use the correct implementation of APIs depending on the application's version, and polyfill the missing APIs if necessary.
8888

89-
[You can find more docs on this here.](/reference/react-compiler/compiling-libraries)
89+
[You can find more docs on this here.](/reference/react-compiler/target#using-the-compiler-on-libraries)
9090

9191
## Opening up React Compiler Working Group to everyone {/*opening-up-react-compiler-working-group-to-everyone*/}
9292

src/pages/[[...markdownPath]].js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,20 @@ export async function getStaticPaths() {
170170

171171
const files = await getFiles(rootDir);
172172

173-
const paths = files.map((file) => ({
174-
params: {
175-
markdownPath: getSegments(file),
176-
// ^^^ CAREFUL HERE.
177-
// If you rename markdownPath, update patches/next-remote-watch.patch too.
178-
// Otherwise you'll break Fast Refresh for all MD files.
179-
},
180-
}));
173+
const paths = files
174+
.filter((file) => {
175+
// Additional safety check: exclude errors directory
176+
const normalizedPath = file.replace(/\\/g, '/');
177+
return !normalizedPath.startsWith('errors/');
178+
})
179+
.map((file) => ({
180+
params: {
181+
markdownPath: getSegments(file),
182+
// ^^^ CAREFUL HERE.
183+
// If you rename markdownPath, update patches/next-remote-watch.patch too.
184+
// Otherwise you'll break Fast Refresh for all MD files.
185+
},
186+
}));
181187

182188
return {
183189
paths: paths,

0 commit comments

Comments
 (0)