1.0.0 • Published 5 years ago

react-smooth-render v1.0.0

Weekly downloads
27
License
-
Repository
-
Last release
5 years ago

React Smooth Render

Mount & unmount react components visually smooth using React Fragments without leaving any footprints.

Demo: https://ferrousdesigner.github.io/react-smooth-render/

Props

PropsTypeDefault ValueDescription
hiddenBoolean(Required)falseDescribes the visibility of the component
initiallyHiddenBooleanfalseDescribes the initial visibility of the component
timingNumber250Animation duration in milliseconds
childrenNode(Required)undefined

Installation

npm install --save react-smooth-render

Usage

import  SmoothRender  from  'react-smooth-render';

class App extends Component {
  state =  {
    hidden: false // State varible which is used to toggle the visibility on SmoothRender
  }
	render() {
		const { hidden } = this.state
		return (
			<div>
				{/* This button toggles the state */}
		        <button 
			        onClick={() => this.setState({ hidden: !hidden })}>
			        Toggle
			     </button>
				<SmoothRender hidden={hidden} timing={350}>
			        <h1>This will mount and unmount smoothly.</h1>
				</SmoothRender>
			</div>
		);
	}
}

export default App;
1.0.0

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago