Skip to content

Data fetching inside the render method. #279

Discussion options

You must be logged in to vote

Correct me if I'm wrong, but as far as I understand, you're going to unconditionally show the particular details for every row anyway.
In which case, why wouldn't you load the nested details upfront and have them in a structure like this:

[
  {
    "id": 1,
    "title": "Todo 1",
    "tasks": [
      { "id": 100, "title": "Task 1.1" },
      { "id": 101, "title": "Task 1.2" },
      { "id": 102, "title": "Task 1.3" }
    ],
    "author": { "id": 1000, "name": "John Doe" }
  },
  {
    "id": 2,
    "title": "Todo 2",
    "tasks": [
      { "id": 200, "title": "Task 2.1" },
      { "id": 201, "title": "Task 2.2" },
      { "id": 202, "title": "Task 2.3" }
    ],
    "author": { "id": 2000, "…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Saifurrahmanemon
Comment options

@icflorescu
Comment options

Answer selected by Saifurrahmanemon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants