Sha256: 4104a35d28bf16725ce53ea5a54154cd20c8a04f48d7b71ed9a908ea44e05992

Contents?: true

Size: 705 Bytes

Versions: 15

Compression:

Stored size: 705 Bytes

Contents

module React
  module Server
    def self.render_to_string(element)
      if !(`typeof ReactDOMServer === 'undefined'`)
        React::RenderingContext.build { `ReactDOMServer.renderToString(#{element.to_n})` } # v0.15+
      else
        raise "renderToString is not defined.  In React >= v15 you must import it with ReactDOMServer"
      end
    end

    def self.render_to_static_markup(element)
      if !(`typeof ReactDOMServer === 'undefined'`)
        React::RenderingContext.build { `ReactDOMServer.renderToStaticMarkup(#{element.to_n})` } # v0.15+
      else
        raise "renderToStaticMarkup is not defined.  In React >= v15 you must import it with ReactDOMServer"
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
hyper-component-0.99.6 lib/react/server.rb
hyper-component-0.99.5 lib/react/server.rb
hyper-component-0.99.4 lib/react/server.rb
hyper-component-0.99.3 lib/react/server.rb
hyper-component-0.99.2 lib/react/server.rb
hyper-component-0.99.1 lib/react/server.rb
hyper-component-0.99.0 lib/react/server.rb
hyper-react-1.0.0.lap28 lib/react/server.rb
hyper-react-1.0.0.lap27 lib/react/server.rb
hyper-react-1.0.0.lap26 lib/react/server.rb
hyper-react-1.0.0.lap25 lib/react/server.rb
hyper-react-1.0.0.lap24 lib/react/server.rb
hyper-react-1.0.0.lap23 lib/react/server.rb
hyper-react-1.0.0.lap22 lib/react/server.rb
hyper-react-1.0.0.lap21 lib/react/server.rb