Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For comparison [see this commit][commit] Interestingly, Superglue doesn't have this problem. Recall earlier, that we used the same `index.js` component for the `show` and `index` action. ``` const identifierToComponentMapping = { 'seats/index': SeatsIndex, 'seats/show': SeatsIndex, } ``` Because of this, we can rely on React's VDOM diffing to just change the DOM nodes that needs to change. We do have to reset the map when ever we receive props to achieve the same effect when switching floors. And with that we introduce the first use of Superglue's UJS helpers, here's the relevant diff: ``` - <a href={path} className={className}>{name}</a> + <a href={path} className={className} data-sg-visit={true}>{name}</a> ``` Superglue's UJS helpers are similar to Rails, but you must explicitly opt-in by adding a data attribute. Options include `data-sg-remote`, and `data-sg-visit`, the difference being that `data-sg-visit` will push history state. These UJS helpers are convenience to using Superglue's out-of-the-box thunks: `visit` and `remote`. If you ever need fine grain control of the way your application fetches, these thunks are passed as props to your page component. [commit]: seanpdoyle@23725b6
- Loading branch information