Sha256: e03a21faa5e6a680d6f4a5ef3f18c07f0ec905de7dd1c886ec532ad9e170e57e
Contents?: true
Size: 590 Bytes
Versions: 20
Compression:
Stored size: 590 Bytes
Contents
class Route < Preact::Component self.context_type = RouterContext render do route_match = @context[:router][:matcher].call(props[:path], @context[:location]) matches, params = props[:match] || route_match if matches component = props[:component] component_props = props[:component_props] || {} if component component = component.constantize if component.is_a?(String) RPE(Preact.create_element(component, component_props.merge!({ params: params }))) else RPE(props[:children]) end end end end
Version data entries
20 entries across 20 versions & 1 rubygems