Sha256: 3ebceaf4515a41ffacf1642707a1c1c569fb6f94e1f62df876ac44669f9dc3bc

Contents?: true

Size: 666 Bytes

Versions: 1

Compression:

Stored size: 666 Bytes

Contents

<%= file_header %>
interface I<%= component_name %>Props {
  <% if attributes.size > 0 -%>
  <% attributes.each do |attribute| -%>
  <% if attribute[:union] -%>
  <%= attribute[:name].camelize(:lower) %>: <%= attribute[:name].titleize %>;
  <% else -%>
  <%= attribute[:name].camelize(:lower) %>: <%= attribute[:type] %>;
  <% end -%>
  <% end -%>
  <% end -%>
}

const <%= component_name %> = (props: I<%= component_name %>Props) => {
  return (
    <React.Fragment>
      <% attributes.each do |attribute| -%>
      <%= attribute[:name].titleize %>: {props.<%= attribute[:name].camelize(:lower) %>}
      <% end -%>
    </React.Fragment>
  )
}

<%= file_footer %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
react-rails-3.2.0 lib/generators/templates/component.es6.tsx