mirror of
https://github.com/bobwen-dev/react-templates
synced 2025-04-12 00:56:39 +02:00
More docs
This commit is contained in:
parent
04a4b135fa
commit
d4608fe8dc
@ -8,10 +8,12 @@ Light weight templates for react. Reasons that we love it:
|
||||
* Declerative coding for presentation. HTML that you write and inspect look similar
|
||||
* Easy syntax. Similar to HTML. All IDEs recognize this format
|
||||
|
||||
[TOC]
|
||||
|
||||
## How does it work
|
||||
React templates compiles a *.rt file (react template - extended HTML format) into a javascript file. Currently, this file supports requirejs format, that will return a function. This function, when applied, will return a virtual react DOM (based on React.DOM elements and user custom components). A common use case would be that a React component would require a JS file generated by a template, and then call `func.apply(this)`, causing the template to have the component as its context.
|
||||
|
||||
###### Basic concepts for react templates:
|
||||
###### Basic concepts for react templates
|
||||
* Any valid HTML is a template (and comments)
|
||||
* {} to identify JS expression
|
||||
* rt-if
|
||||
|
Loading…
x
Reference in New Issue
Block a user