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
{{ message }}
This repository was archived by the owner on Oct 19, 2018. It is now read-only.
* Use helper method `define_state` to create setter & getter of `this.state` for you
119
119
* For the detailed mapping to the original API, see [this issue](https://github.com/zetachang/react.rb/issues/2) for reference. Complete reference will come soon.
120
120
121
+
### Element Building DSL
122
+
123
+
As a replacement of JSX, include `React::Component` and you can build `React.Element` hierarchy without all the `React.create_element` noises.
124
+
125
+
```ruby
126
+
defrender
127
+
div do
128
+
h1 { "Title" }
129
+
h2 { "subtitle"}
130
+
div(class_name:'fancy', id:'foo') { span { "some text #{interpolation}"} }
131
+
present FancyElement, fancy_props:'10'
132
+
end
133
+
end
134
+
```
135
+
121
136
### Props validation
122
137
123
138
How about props validation? Inspired by [Grape API](https://github.com/intridea/grape), props validation rule could be created easily through `params` class method as below,
0 commit comments