Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for data-transition attributes used by Push.js #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

creature
Copy link

I've been using React-ratchet to build an app that supports server-side rendering. One useful facility provided by Ratchet is Push.js, a tool that takes a page load and animates the transition between pages. To enable that, Push.js looks for a data-transition attribute on links.

This changeset adds support for an optional transition prop on the <TableViewCell> and <NavButton> components, that get added as a data- attribute on the generated links. This is only strictly necessary on the <TableViewCell> because <NavButton> automatically copies all its props to attributes, but I thought it better to have a consistent interface. I've added tests too, but there's probably a neater way to write them.

I also had to make some tweaks to the package.json file to make the test suite run (as I was hitting errors along these lines), but these could be backed out if they're not universally applicable.

If TableViewCell has an href prop, then the transition prop gets
included as a data-transition attribute on the child <a href> tag.
Push.js uses this attribute to transition views in and out.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant