This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Description
the fix for issue #15 was put into Hyper::Router::Mixin rather than Hyper::Router::Base. This means that every component creating a HyperRouter component (like using NavLink etc) was also adding a before_mount callback. But more critically the fix was using before_mount instead of after_mount so it was being invoked during prerrendering.
The actual code should look like this:
module Hyperloop
class Router
module Base
...
base.class_eval do
after_mount do # thas was in Hyperloop::Router::Mixin BEFORE_MOUNT
@_react_router_unlisten = history.listen do |location, _action|
React::State.set_state(HyperRouter, :location, location)
end
end
before_unmount do
@_react_router_unlisten.call if @_react_router_unlisten
end
end
end
end
end
end