Skip to content

JSX Blocks like in ruby #100

Open
Open
@shaedrich

Description

@shaedrich

As addressed another issue in the reactJS repo JSX Control Statements like this

<If condition={this.isUserLoggedIn()}>
  <UserPanel /> 
</If>

are a nice approach to have JSX-HTML between something like a conditional or a loop, but it would be even better if JSX could support something like this natively as it is used in Ruby:

[1, 2, 3].each do |n|
  puts "Number #{n}"
end

in templates:

<% if this.isUserLoggedIn()? %>
    <%= partial "UserPanel" %>
<% end %>

so in JSX it could look like this:

{if this.isUserLoggedIn()}
    <UserPanel />
{end}

Metadata

Metadata

Assignees

No one assigned

    Labels

    ProposalProposals (haven't confirmed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions