diff --git a/README.md b/README.md index 425d77c5..de046470 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,12 @@ $ rails g react:component my_subdirectory/HelloWorld greeting:string ``` Note: Your component is added to `app/javascript/components/` by default. +Note: If your component is in a subdirectory you will append the directory path to your erb component call. + +Example: +``` +<%= react_component("my_subdirectory/HelloWorld", { greeting: "Hello from react-rails." }) %> +``` ##### 7) [Render it in a Rails view](#view-helper):