Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

chore: format transitions props doc #14

Merged
merged 1 commit into from
May 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions src/pages/md/Transition-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ _Transitions inherit from Keyframes_, so its slots (initial, from, enter, leave

_Transition accepts all spring properties_: native, from, immediate, onRest, and so on.

|  Property |  Type |  Required |  Default |  Description |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| keys |  Union |  false |  item => item |  The same keys you would normally hand over to React in a list. Keys can be specified as a key-accessor function, an array of keys, or a single value |
| unique |  Bool |  false |  false |  When true enforces that an item can only occur once instead of allowing two or more items with the same key to co-exist in a stack |
| reset |  Bool |  false |  false Useful in combination with "unique", when true it forces incoming items that already exist to restart instead of adapting to their current values |
| initial |  Union |  false |  - |  First-render initial values, if present overrides "from" on the first render pass. It can be "null" to skip first mounting transition. Otherwise it can take an object or a function item => object) |
| from |  Union |  false |  - |  Base values (from -> enter), or: item => values |
| enter |  Union |  false |  - |  Values that apply to new elements, or: item => values |
| leave |  Union |  false |  - |  Values that apply to leaving elements, or: item => values |
|  update |  Union |  false |  - |  Values that apply to elements that are neither entering nor leaving (you can use this to update present elements), or: item => values |
|  trail |  Number |  false |  - |  Trailing delay in ms |
| config Union false - Spring config, or for individual keys: fn((item,type) => key => config) or fn((item,type) => config), where "type" can be either enter, leave or update  |
|  onDestroyed |  Func |  false |  - |  Calls back once a transition is about to wrap up |
|  items |  Union |  true |  - |  An array of items to be displayed (or a single item of any type), this is used by Transition as the primary means of detecting changes. |
|  children |  Func |  true |  - |  A single function-child that receives the individual item and return a functional component (item => props => view)  |
| Property | Type | Required | Default |  Description |
| -------- | ---- | -------- | ------- | ------------ |
| keys | Union | false | item => item | The same keys you would normally hand over to React in a list. Keys can be specified as a key-accessor function, an array of keys, or a single value |
| unique | Bool | false |  false | When true enforces that an item can only occur once instead of allowing two or more items with the same key to co-exist in a stack |
| reset | Bool | false | false | Useful in combination with "unique", when true it forces incoming items that already exist to restart instead of adapting to their current values |
| initial | Union | false | - | First-render initial values, if present overrides "from" on the first render pass. It can be "null" to skip first mounting transition. Otherwise it can take an object or a function item => object) |
| from | Union | false | - | Base values (from -> enter), or: item => values |
| enter | Union | false | - | Values that apply to new elements, or: item => values |
| leave | Union | false | - | Values that apply to leaving elements, or: item => values |
| update | Union | false | - | Values that apply to elements that are neither entering nor leaving (you can use this to update present elements), or: item => values |
| trail | Number | false | - | Trailing delay in ms |
| config | Union | false | - | Spring config, or for individual keys: fn((item,type) => key => config) or fn((item,type) => config), where "type" can be either enter, leave or update |
| onDestroyed | Func | false | - | Calls back once a transition is about to wrap up. |
| items | Union | true | - | An array of items to be displayed (or a single item of any type), this is used by Transition as the primary means of detecting changes. |
| children | Func | true | - | A single function-child that receives the individual item and return a functional component (item => props => view) |

## Demos