Hello, does anyone have an idea with the template remix how to redirect to a specific page (the goal is to display an onboarding page) right after installing the application? Thank you !
Hey @Antoine_dev,
You can see an example here on how to implement a redirect: Admin
For an example of how it’s used, there’s an example in our billing documents on how this is used to redirect to a billing page. You could do similar to redirect to your onboarding page: Redirect to the plan selection page
Let me know if that helps!
Hey @ KyleG-Shopify, thank you for your reply !
Is it a good practice to manage all session and user data registration + data recovery after installation in the root.tsx file and manage pricing and onboarding redirections in the routes/app file? (with the remix template)
Hey @Antoine_dev, thanks for following up. Looking further in to this, can you clarify a little more context around what you mean by this:
Hello, I retrieve all my database data from my root file and share it throughout all my application via a hook retrieved from the client. I also manage user registration from this same file and this information. To eventually redirect to Billing or Onboarding pages, I check in my loader in the different pages if I have to redirect, I don’t know if it’s a good practice.
Thanks for sharing that.
For best practices, the Remix documentation on the root file would be helpful here. You might want to load only the data you need in your route-specific loaders.
For handling redirects to billing or onboarding pages, our recommended approach is shown in the billing example I linked earlier, where the redirect check happens in the app.jsx file.
Thank you @KyleG-Shopify