简体   繁体   中英

Use Meteor components in React

I have a Meteor app built using blaze. Now I am shifting the UI to react. I have just started learning react and hence I am confused how to use #with, #each, etc., in reactjs.

Code Sample:

<div className="page-content {{#unless}} FLT rd-body {{/unless}}">

How to use '#unless', '#with' and other Meteor components in ReactJS?

Also, how to use Session variables in reactjs?

Read the manuals:

https://guide.meteor.com/react.html and https://www.meteor.com/tutorials/react/creating-an-app .

Especially the first link. It contains the syntax to embed react JSX into blaze templates or use blaze templates as JSX components. So you basically have to decide which templating system you're going to cast to the other system.

Concerning the session variables, have a look at the react documentation.

React is a library to create web-ui eg the 'view-layer'. Meteor is a framework, build-system and server all-in-one.

Blaze is the default view-layer. In Blaze you can make your html dynamic with the {{ .. }} tags, as you use above.

React works differently. React templates are Javascript files mixed with HTML. Usually with extension .jsx. I'd visit https://reactjs.org/ for more information, or one of the many tutorials and books that exist.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM