1.0.2 • Published 5 years ago

react-ciao v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

React Ciao

Used to add css classes to its children while they are entering or exiting the DOM.

React version

  • Uses the new lifecycle methods introduced in React 16.3

Install

yarn add react-ciao
npm install react-ciao

Import

import Ciao from 'react-ciao';
import {Ciao} from 'react-ciao';

Usage

Ciao takes the following props

PropertyTypeRequiredUsageDefault
enterClassstringtrueThis class will be added to the wrapped component when it enters the DOM-
exitClassstringtrueThis class will be added to the wrapped component before it exits the DOM-
exitDurationnumbertrueIn milliseconds. Should match or be less than the sum of the animation duration and animation delay defined in the css file in the corresponding exitClass. If this duration is greater, then the wrapped content will stay rendered for a moment equal to the difference.-
  • NB: In case the children are components/functional components they must accept the className prop in order to get the above classes.

Wrap content and add the props

<Ciao {...props}> content </Ciao>

Browser Support

  • Chrome, Edge, Firefox, IE11, Safari. Tested on mobile devices too.