You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting-started.md
+3-6Lines changed: 3 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,11 +61,8 @@ cd PROJECT_NAME
61
61
62
62
2. Run the install generator:
63
63
64
-
``bash
64
+
```bash
65
65
bundle exec rails generate react_on_rails:install
66
-
67
-
```
68
-
69
66
```
70
67
71
68
Start the app:
@@ -137,11 +134,11 @@ With `auto_load_bundle: true`, and by placing your "exposed" components in the a
137
134
- Automatically registers it for use.
138
135
- Eliminates the need for manual pack configuration.
139
136
140
-
See [Auto-Bundling: File-System-Based Automated Bundle Generation][./guides/auto-bundling-file-system-based-automated-bundle-generation.md]
137
+
See [Auto-Bundling: File-System-Based Automated Bundle Generation](./guides/auto-bundling-file-system-based-automated-bundle-generation.md)
141
138
142
139
Exposing your component in this way allows you to reference the component from a Rails view. You can expose as many components as you like, but their names must be unique. See below for the details of how you expose your components via the React on Rails Webpack configuration. You may call `ReactOnRails.register` many times.
143
140
144
-
-`@some_props` can be either a hash or JSON string. This is an optional argument assuming you do not need to pass any options (if you want to pass options, such as `prerender: true`, but you do not want to pass any properties, simply pass an empty hash `{}`). This will make the data available in your component:
141
+
-`@some_props` can be either a hash or JSON string. This is an optional argument assuming you do not need to pass any options (if you want to pass options, such as `prerender: true`, but you do not want to pass any properties, simply pass an empty hash `{}`). **Props are automatically sanitized by React on Rails for security.**This will make the data available in your component:
145
142
146
143
- This is what your HelloWorld.js file might contain. The railsContext is always available for any parameters that you _always_ want available for your React components. It has _nothing_ to do with the concept of the [React Context](https://react.dev/reference/react/useContext). See [Render-Functions and the RailsContext](./guides/render-functions-and-railscontext.md) for more details on this topic.
0 commit comments