use-rendered

0.1.2 • Public • Published

UseRendered

Use as a substitute for useEffect when waiting for first render. Run once, on mount.

Install

npm install use-rendered

Example code - compare useEffect with useRendered

import React, { useEffect } from 'react';
import { useRendered } from 'use-rendered';

export const SomeComponent = () => {
	useEffect(() => {
		console.log('useEffect: component rendered');
	});

	useRendered(() => {
		console.log('useRendered: component rendered');
	});

	return <h1>useRendered()</h1>;
};

Readme

Keywords

none

Package Sidebar

Install

npm i use-rendered

Weekly Downloads

1

Version

0.1.2

License

none

Unpacked Size

23.1 kB

Total Files

9

Last publish

Collaborators

  • gslinn