Remix vs React: How Remix changes the mental model for building React apps

Поделиться
HTML-код
  • Опубликовано: 5 окт 2024

Комментарии • 3

  • @robb7148
    @robb7148 13 дней назад

    Great video. I have a question about actions if you don’t mind. What if a component is what triggers the action? So say for example you have a page where there’s a table of data. You have a filters component that allows you to filter by some value. Next each row in the table has the ability to edit, duplicate, or delete that data. How is that managed? Can you just pass the action from the route to the component?

  • @user-tt6nc6mo7k
    @user-tt6nc6mo7k 8 месяцев назад +3

    Hey Thomas, I believe your 4th point is not correct. You've said we have to load all our data in a single loader. This is not correct. If you compose your pages with outlets and have loaders in each of your components, Remix will determine all the loaders by looking at each components loader and fetch them in parallel to avoid the waterfall.

    • @st-jn2gk
      @st-jn2gk 2 месяца назад

      I think he meant more granular components. Say you want to render a comment section. In Remix, you'd get the data for all of the comments (or a set number like 25 if you're paginating) then render them once that single loader finishes. In NextJS, each comment box could be a server component, in which case you query the database for each component, or it might be a client component with something like Tanstack Query, in which case you would have spinners.
      You can still have multiple loaders run for different routes, but it will be less granular than component-level fetching.