I’m experimenting with prerendering and would like to implement whileLoadingAuth in our Routes.tsx file per Rendering skeletons while authenticating but I’m getting a linting error following the example:
const MainLoader = () => <MainLayout skeleton />
Unexpected JSX element <MainLayout>. Only <Router>, <Route>, <Set>, <PrivateSet> and <Private> are allowed in the Routes file. eslint(@redwoodjs/unsupported-route-components)
Hi @cdubz , yes documentation is still valid - just have to use PrivateSet instead of Set
It’s possible the linting is throwing the wrong error, but could you share your Routes tree please? As the error says you can’t directly use the MainLoader in your Routes, but should be able to pass it as a render prop
<PrivateSet
unauthenticated="login"
// 👇 tell the router to render the shell until the user has been authenticated
whileLoadingAuth={MainLoader}>
Thanks @cdubz - yes looks like linting is targeting the wrong element. You should be OK to continue using this, its just a linting error. If you would like you can use //eslint-disable-next-line temporarily until we get a fix in.