From dd571ed39b85cf2a58d3546d16ec36e0bb00616e Mon Sep 17 00:00:00 2001 From: Kyle Roach Date: Mon, 10 Dec 2018 16:34:50 -0400 Subject: [PATCH] docs: Update README examples to remove semicolons Closes #265 --- README.md | 58 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 42cfc0e..d8d3fa3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Pure JavaScript, supports dynamic content heights and components that is aware o ## Installation -``` +```bash npm install --save react-native-collapsible ``` @@ -14,23 +14,26 @@ npm install --save react-native-collapsible ```js import Collapsible from 'react-native-collapsible'; - - -; + +() => ( + + + +); ``` ## Properties -| Prop | Description | Default | -| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | -| **`align`** | Alignment of the content when transitioning, can be `top`, `center` or `bottom` | `top` | -| **`collapsed`** | Whether to show the child components or not | `true` | -| **`collapsedHeight`** | Which height should the component collapse to | `0` | -| **`enablePointerEvents`** | Enable pointer events on collapsed view | `false` | -| **`duration`** | Duration of transition in milliseconds | `300` | -| **`easing`** | Function or function name from [`Easing`](https://github.com/facebook/react-native/blob/master/Libraries/Animated/src/Easing.js) (or [`tween-functions`](https://github.com/chenglou/tween-functions) if < RN 0.8). Collapsible will try to combine `Easing` functions for you if you name them like `tween-functions`. | `easeOutCubic` | -| **`style`** | Optional styling for the container | | -| **`onAnimationEnd`** | Callback when the toggle animation is done. Useful to avoid heavy layouting work during the animation | `() => {}` | +| Prop | Description | Default | +| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | +| **`align`** | Alignment of the content when transitioning, can be `top`, `center` or `bottom` | `top` | +| **`collapsed`** | Whether to show the child components or not | `true` | +| **`collapsedHeight`** | Which height should the component collapse to | `0` | +| **`enablePointerEvents`** | Enable pointer events on collapsed view | `false` | +| **`duration`** | Duration of transition in milliseconds | `300` | +| **`easing`** | Function or function name from [`Easing`](https://github.com/facebook/react-native/blob/master/Libraries/Animated/src/Easing.js) (or [`tween-functions`](https://github.com/chenglou/tween-functions) if < RN 0.8). Collapsible will try to combine `Easing` functions for you if you name them like `tween-functions`. | `easeOutCubic` | +| **`style`** | Optional styling for the container | | +| **`onAnimationEnd`** | Callback when the toggle animation is done. Useful to avoid heavy layouting work during the animation | `() => {}` | ## Accordion Usage @@ -38,14 +41,17 @@ This is a convenience component for a common use case, see demo below. ```js import Accordion from 'react-native-collapsible/Accordion'; -; + +() => ( + +); ``` ## Properties @@ -86,17 +92,17 @@ import Accordion from 'react-native-collapsible/Accordion'; const SECTIONS = [ { title: 'First', - content: 'Lorem ipsum...' + content: 'Lorem ipsum...', }, { title: 'Second', - content: 'Lorem ipsum...' - } + content: 'Lorem ipsum...', + }, ]; class AccordionView extends Component { state = { - activeSections: [] + activeSections: [], }; _renderSectionTitle = section => {