lib/hyperstack/internal/router/helpers.rb in hyper-router-1.0.alpha1.5 vs lib/hyperstack/internal/router/helpers.rb in hyper-router-1.0.alpha1.6

- old
+ new

@@ -29,11 +29,11 @@ status ||= 302 `#{IsomorphicMethods.ctx}.status = #{status}` React::Router::Redirect(opts) end - def format_params(e) + def format_params(e, *) { match: Hyperstack::Router::Match.new(`#{e}.match`), location: Hyperstack::Router::Location.new(`#{e}.location`), history: Hyperstack::Router::History.new(`#{e}.history`) } @@ -45,19 +45,19 @@ opts[:path] = to.to_n if opts[:mounts] component = opts.delete(:mounts) - opts[:component] = lambda do |e| - route_params = format_params(e) + opts[:component] = lambda do |*e| + route_params = format_params(*e) Hyperstack::Component::ReactAPI.create_element(component, route_params).to_n end end if block - opts[:render] = lambda do |e| - route_params = format_params(e) + opts[:render] = lambda do |*e| + route_params = format_params(*e) yield(*route_params.values).to_n end end