![]() Avatar Colocated Fragment for importing its fields. At the same time, we are creating a PostHeader Colocated Fragment, which is composed of some individual fields and the author field.First, we import the Avatar component, which is used by PostHeader for rendering the author's information, but when we import Avatar we are also importing it Colocated Fragments through the fragment attribute!. ![]() ![]() Let's use a PostHeader component as an example, which will use the Avatar component for rendering the author information: You can only realize Colocated Fragments magic when you start consuming them. (If you use typescript, There's a "step by step" section on how to generate your prop types automatically based on the Colocated Fragment definition).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |