Skip to content

Conversation

@christopherpickering
Copy link

This pr updates remix to v 1.16.1 to resolve this issue.

Thanks for the great example!

@christopherpickering
Copy link
Author

A few more comments of what would need to be changed to work with remix v2.

remix.config.js

The following could be added to the exports:

future: {
    v2_routeConvention: true,
    v2_errorBoundary: true,
    v2_meta: true,
    v2_normalizeFormMethod: true,
  },
serverModuleFormat:"cjs",

Routes

The route structure should be flattened (note the double underscore to single as well):

image

root.tsx

Metadata function could be updated to the new format:

export const meta: MetaFunction = () => ([
    {charset: 'utf-8'},
    {title: 'Payload CMS & Remix Monorepo'},
    {viewport: 'width=device-width,initial-scale=1'},
]);

_page.$page.tsx

Metadata could be updated to the new format (note the change in the findPageBySlug params as well)

export const meta: MetaFunction = ({ params, matches }) => {
    const { page: pageSlug } = params;

    const page = findPageBySlug(pageSlug ?? 'home', matches);
    return [{
        title: page?.meta.title},
        {description: page?.meta.description},
        {keywords: page?.meta.keywords},
    ];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant