1.0.1 • Published 4 years ago

lifecycler v1.0.1

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

Lifecycler

Build Status Coverage Status semantic-release

A simple-to-use React rendered lifecycle component. Hook into lifecycle events while building stateless components.

Installing

Lifecycler can be installed via npm:

$ npm i -S lifecycler

Usage

Use Lifecycler inside your React project by wrapping it around a component to add lifecycle methods to:

import React from 'react';
import Lifecycler from 'lifecycler';

const logAfterMounting = () => console.log('The component has mounted');

const MyComponent = () => (
  <Lifecycler componentDidMount={logAfterMounting}>
    <p>This here is wrapper in Lifecycler!</p>
  </Lifecycler>
);

export default MyComponent;

Properties

Lifecycler exposes most lifecycle methods, please check the official component documentation for more information:

Mounting:

  • componentDidMount()

Updating

  • shouldComponentUpdate(nextProps, nextState)

    This method should return a boolean value. If no value (or a non-booean value) is returned, Lifecycler will return true for you. Because these are still stateless components, nextState will always be null.

  • componentDidUpdate(prevProps, prevState)

    Because these are still stateless components, nextState will always be null.

Unmounting

  • componentWillUnmount()
1.0.1

4 years ago

1.0.0

4 years ago

0.2.0

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.1

7 years ago