Skip to content

Commit 21cbb89

Browse files
authored
Merge pull request #1060 from BabsLabs/nested_components_readme_update
Add nested component call info
2 parents d5da111 + d754987 commit 21cbb89

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ $ rails g react:component my_subdirectory/HelloWorld greeting:string
114114
```
115115
Note: Your component is added to `app/javascript/components/` by default.
116116

117+
Note: If your component is in a subdirectory you will append the directory path to your erb component call.
118+
119+
Example:
120+
```
121+
<%= react_component("my_subdirectory/HelloWorld", { greeting: "Hello from react-rails." }) %>
122+
```
117123

118124
##### 7) [Render it in a Rails view](#view-helper):
119125

0 commit comments

Comments
 (0)