Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react #13

Open
TokenYangForever opened this issue Nov 14, 2017 · 0 comments
Open

react #13

TokenYangForever opened this issue Nov 14, 2017 · 0 comments

Comments

@TokenYangForever
Copy link
Owner

  • JSX In Depth: react的组件必须以大写字母命名: ,小写字母的标签会被认为是html的标签而不会被编译。一般表达式声明react的组件也要用大写字母开头:
const SpecificStory = components[props.storyType];
  return <SpecificStory story={props.story} />;
  • 条件渲染:
<div>
  {showHeader && <Header />}
  <Content />
</div>
<div>
  {props.messages.length > 0 &&
    <MessageList messages={props.messages} />
  }
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant