-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MetaArgs should be renamed to MetaFunctionArgs to match the rest of remix API types #9141
Comments
I'm not sure if it was intentional or accidental.
export function meta({
data,
params,
location,
matches,
}: MetaArgs<
typeof loader, // current route loader data type
{
"root": typeof rootLoader; // specify types for parent loader matches
"routes/parent": typeof parentLoader;
}
>) {
console.log(data, params, location, matches);
const m = matches.find((m) => m.id === "routes/parent");
console.log(m?.data.name);
return [
{ title: "New Remix App" },
{ name: "description", content: "Welcome to Remix!" },
];
} |
@kiliman yep, I'm aware, just a suggestion so devs can look at the docs less 😅 |
@kiliman just out of curiosity do you happen to know why its an interface? are there reasons to do declaration merging on the interface? |
No, I'm not sure of the reasoning behind it. Anyway, it looks like the naming was an oversight. In the Remix v2.0 release, they renamed In fairness, the |
I think they could just add the |
Reproduction
the API Surface in Remix should be guessable.
System Info
Used Package Manager
pnpm
Expected Behavior
ActionFunction <-> ActionArgs
Loaderfunction <-> LoaderArgs
MetaFunction <-> MetaArgs
or
ActionFunction <-> ActionFunctionArgs
Loaderfunction <-> LoaderFunctionArgs
MetaFunction <-> MetaFunctionArgs
Actual Behavior
MetaArgs is inconsistent with the rest of the remix API
The text was updated successfully, but these errors were encountered: