new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

React Router · API · all subjects

utilities & helpers

7 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

data() utility function

The data() utility function from react-router is used to return data from an action. It accepts two parameters: the data object and an options object. The options object can include a status property to set the HTTP response status code, for example: data({ errors }, { status: 400 }).

redirect() utility function

The redirect() utility function from react-router is used in actions to redirect the user to a different route after successful processing. It returns a response that causes client-side navigation. For example: redirect("/dashboard").

routeRSCServerRequest API function

The `routeRSCServerRequest` API from react-router handles the incoming request, calls the RSC server, and converts the RSC payload into HTML for server-side rendering on document requests. It is used in entry.ssr.tsx.

matchRSCServerRequest API function

The `matchRSCServerRequest` API from react-router matches requests to routes and generates RSC payloads. It is used in entry.rsc.tsx (the React Server entry point).

createCallServer API function

The `createCallServer` API from react-router/dom is used in entry.browser.tsx to create the callServer function that supports post-hydration server actions. It requires createFromReadableStream, createTemporaryReferenceSet, and encodeReply from @vitejs/plugin-rsc/browser.

getRSCStream API function

The `getRSCStream` API from react-router/dom retrieves the initial RSC payload stream from the HTML document for client-side hydration in entry.browser.tsx.

RSCPayload type from react-router/dom

The `RSCPayload` type is exported from react-router/dom as `unstable_RSCPayload` and represents the RSC server payload used for client hydration.

Give your agent this brain