Skip to content

Commit 6abc21d

Browse files
committed
regression from #186
1 parent ece10ec commit 6abc21d

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

docs/installation/installation.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -260,16 +260,16 @@ you will may want to direct the output to a dedicated log file for example.
260260

261261
The Rails webpacker gem will bundle up all your javascript assets including those used by Hyperstack such as React, and React-Router.
262262

263-
You can also easily add other NPM (node package manager) assets to the webpacker *pack files*.
263+
You can easily add other NPM (node package manager) assets to the webpacker *pack files*.
264264

265-
Hyperstack will look for two webpacker pack files: one for packages that *only* run on the client side, and packages that can run on *both* the client, and during server prerendering.
265+
Hyperstack will look for two pack files: one for packages that *only* run on the client side, and the other for packages that can run on *both* the client and during server prerendering.
266266
> Prerendering builds the initial page view server side, and then delivers it to the client as a normal static HTML page. Attached to the HTML are flags that React will use update the page as components are re-rendered after the initial page load.
267267
>
268268
> This means that page load time is comparable to any other Rails view.
269269
>
270-
> But to make this work packages that rely on the `browser` object, cannot be used during prerendering. Well structured packages that depend on the `browser` object will have a way to run in the prerendering environment.
270+
> But to make this work packages that rely on the `browser` object cannot be used during prerendering. Well structured packages that depend on the `browser` object will have a way to run in the prerendering environment.
271271
272-
You will also need to fetch the packages, plus any of their dependencies and bring them into your build environment.
272+
Once you have the pack files setup you will also need to fetch the packages, plus any of their dependencies and bring them into your build environment.
273273

274274
> Coming from Ruby this can be confusing as we are used to simply adding a dependency into the `Gemfile`, and then using bundler to both fetch dependencies, and produce the `Gemfile.lock` file.
275275
>
@@ -309,12 +309,19 @@ First you need make sure you have `yarn` installed:
309309
Once yarn is installed you need to add the following packages which Hyperstack depends on:
310310

311311
```text
312-
yarn add react@16 react-dom@16 \
313-
react-router@^5.0.0 react-router-dom@^5.0.0 \
314-
react_ujs@^2.5.0 jquery@^3.4.1
312+
yarn add react@16
313+
yarn add react-dom@16
314+
yarn add react-router@^5.0.0
315+
yarn add react-router-dom@^5.0.0
316+
yarn add react_ujs@^2.5.0
317+
yarn add jquery@^3.4.1
315318
```
316319

317-
And now you are good to go. In the future if you want to add a new
320+
And now you are good to go. In the future if you want to add a new package like [react-datepicker](https://reactdatepicker.com/), you would run
321+
322+
`yarn add react-datepicker`
323+
324+
318325

319326
### Add the Hyperstack engine to the routes file
320327

ruby/hyper-component/lib/hyperstack/component/element.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def merge_built_in_event_prop!(prop_name, &block)
121121
prop_name => %x{
122122
function(){
123123
var react_event = arguments[0];
124-
if (arguments.length == 0 || react_event.constructor.name != 'SyntheticEvent') {
124+
if (arguments.length == 0 || !react_event.nativeEvent) {
125125
return #{yield(*Array(`arguments`))}
126126
}
127127
var all_args;

0 commit comments

Comments
 (0)