README.md in hyper-router-4.0.0 vs README.md in hyper-router-4.0.1

- old
+ new

@@ -1,9 +1,20 @@ -## HyperRouter +<p align="center"> + <a href="http://ruby-hyperloop.io/" alt="Hyperloop" title="Hyperloop"> + <img src="https://github.com/ruby-hyperloop/ruby-hyperloop.io/blob/sprint/source/images/HyperRouter.png" width="150px"/> + </a> + </p> -HyperRouter allows you write and use the React Router in Ruby through Opal. +<h1 align="center"> + HyperRouter +</h1> +<p align="center"> + HyperRouter allows you write and use the React Router in Ruby through Opal. +</p> + + ## Installation Add this line to your application's Gemfile: ```ruby gem 'hyper-router' @@ -199,11 +210,11 @@ self.class.browser_history end end ``` -### BrowserRouter, HashRouter, MemoryRouter, StaticRouter +### BrowserRouter, HashRouter, MemoryRouter Using one of these classes automatically takes care of the history for you, so you don't need to specify one. They also can be used by inheritance or inclusion: @@ -211,9 +222,28 @@ class MyRouter < Hyperloop::HashRouter end class MyRouter < React::Component::Base include Hyperloop::Router::Hash +end +``` + +### StaticRouter + +Static router is a little different, since it doesn't actually have a history. +These are used under-the-hood for any other Router during prerendering. +To use a path with a StaticRouter, with the macro `initial_path`. +This acts the same as `prerender_path` for other routers. + +```ruby +class MyRouter < Hyperloop::StaticRouter + initial_path :current_path + + route do + DIV do + Route('/:name', mounts: Greet) + end + end end ``` ### Rendering a Router