Skip to content

Commit e683f2d

Browse files
author
Vlad Balin
committed
Update README.md
1 parent 7e96f01 commit e683f2d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ safe to use it as a replacement for `react`.
2828

2929
If you're migrating from backbone-based frameworks such as `ChaplinJS` or `Marionette`,
3030
you need to do following things to make convergence layer work properly:
31+
3132
- Make sure that frameworks includes `nestedtypes` instead of `backbone`.
3233
- On application start, tell `nestedreact` to use proper base class for the View.
3334
`React.useView( Chaplin.View )`
@@ -70,7 +71,8 @@ attribute spec syntax). It has following implications:
7071
- State attributes behaves as regular object attributes, which can be directly accessed and assigned.
7172
- State attributes can hold deeply nested models and collections; deep changes will be automatically detected and will cause component update.
7273

73-
In addition,
74+
In addition,
75+
7476
- `state` property from mixins will be properly merged. So, mixins can have state too.
7577
- You can specify the base class for state model using `Model` component's property.
7678
- Entire model's state can be externally defined as `NestedTypes` Model, and attached to component by referencing it in `Model` property.
@@ -139,6 +141,7 @@ NestedReact support this optimization, comparing props model's and collection ve
139141
and comparing other props values for strict equality.
140142

141143
To enable this optimization for the particular component, you need to:
144+
142145
- Declare all props that will be tracked for changes in `props` (or `propTypes`) spec.
143146
Which is the good practice by itself, so you encouraged to do it unless you're using
144147
stateless function components syntax, which is preferable.
@@ -169,6 +172,7 @@ NestedReact `props` spec uses the simple subset of `state` spec, and acts as sub
169172
it internally compiles itself to the `propTypes` and `getDefaultProps()`).
170173

171174
Following type annotations are allowed for `props`:
175+
172176
1. Constructor functions: `prop1 : String`
173177
2. Constructors with default value: `prop2 : String.value( "default string" )`
174178
3. JSON and primitive values: `prop3 : "default string"`

0 commit comments

Comments
 (0)