All Projects → soroushchehresa → react-ignore-rerender

soroushchehresa / react-ignore-rerender

Licence: other
🚀 Simple component for ignoring the re-rendering of a piece of React's render method.

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to react-ignore-rerender

griding
🧱 lean grid & responsive for react
Stars: ✭ 18 (-35.71%)
Mutual labels:  react-component
vscode-exts
Visual Studio Code Extensions
Stars: ✭ 33 (+17.86%)
Mutual labels:  react-component
react-dates
An easily internationalizable, mobile-friendly datepicker library for the web
Stars: ✭ 12,032 (+42871.43%)
Mutual labels:  react-component
insect
🛠 Highly customisable, minimalistic input x select field for React.
Stars: ✭ 33 (+17.86%)
Mutual labels:  react-component
react-native-tabbar
A tabbar component for React Native
Stars: ✭ 59 (+110.71%)
Mutual labels:  react-component
react-mason
React Masonry grid
Stars: ✭ 13 (-53.57%)
Mutual labels:  react-component
react-octicon
A GitHub Octicons icon React component
Stars: ✭ 76 (+171.43%)
Mutual labels:  react-component
react-textarea-code-editor
A simple code editor with syntax highlighting.
Stars: ✭ 247 (+782.14%)
Mutual labels:  react-component
Registration-and-Login-using-MERN-stack
Simple Registration and Login component with MERN stack
Stars: ✭ 210 (+650%)
Mutual labels:  react-component
react-timer-wrapper
Composable React Timer component that passes status props to children, in addition to some basic callbacks. Can be used at a countdown timer ⏲ or as stopwatch ⏱ to track time while active.
Stars: ✭ 14 (-50%)
Mutual labels:  react-component
shared-react-components-example
An example of a mono-repository of shared React components libraries!
Stars: ✭ 85 (+203.57%)
Mutual labels:  react-component
picker
📅 All Date Pickers you need.
Stars: ✭ 185 (+560.71%)
Mutual labels:  react-component
react-scroll-trigger
📜 React component that monitors scroll events to trigger callbacks when it enters, exits and progresses through the viewport. All callback include the progress and velocity of the scrolling, in the event you want to manipulate stuff based on those values.
Stars: ✭ 126 (+350%)
Mutual labels:  react-component
react-render-tracker
React render tracker – a tool to discover performance issues related to unintentional re-renders and unmounts
Stars: ✭ 1,954 (+6878.57%)
Mutual labels:  rerender
react-ratings-declarative
A customizable rating component for selecting x widgets or visualizing x widgets
Stars: ✭ 41 (+46.43%)
Mutual labels:  react-component
react-dice-complete
Complete dice rolling functionality and animations
Stars: ✭ 60 (+114.29%)
Mutual labels:  react-component
React-Express-JWT-UserPortal
React.js & Express.js User portal Using Core UI, JWT, JWT Token, Refresh Token, Role & Permission management, User manamgenet, Event Log.
Stars: ✭ 22 (-21.43%)
Mutual labels:  react-component
react-tags-input
[Not Actively Maintained] An input control that handles tags interaction with copy-paste and custom type support.
Stars: ✭ 26 (-7.14%)
Mutual labels:  react-component
git-issue-react-electronjs
⚙️. ⚛️. A desktop application created with Electronjs and Reactjs to be cross-platform to manage and track GitHub issues.
Stars: ✭ 21 (-25%)
Mutual labels:  react-component
react-grid
react grid component
Stars: ✭ 17 (-39.29%)
Mutual labels:  react-component

react-ignore-rerender

NPM JavaScript Style Guide

Simple component for ignoring the re-rendering of a piece of React's render method.

Installation

npm:

npm i -S react-ignore-rerender

yarn:

yarn add react-ignore-rerender

Usage

Without whiteList:

import React, { Component } from 'react';
import IgnoreRerender from 'react-ignore-rerender';

class ExampleComponent extends Component {
  constructor(props) {
    super(props);
    this.state = {
      showTitle: true,
      showDescription: true,
    };
  }
  render () {
    const {showTitle, showDescription} = this.state;
    return (
      <div>
        { showTitle && <h1>Title</h1> }
        { showDescription && <p>Description</p> }
        <IgnoreRerender>
          <ul className="list">
            <li className="list-item">list item 1</li>
            <li className="list-item">list item 2</li>
            <li className="list-item">list item 3</li>
            <li className="list-item">list item 4</li>
            <li className="list-item">list item 5</li>
            <li className="list-item">list item 6</li>
            <li className="list-item">list item 7</li>
          </ul>
        </IgnoreRerender>
      </div>
    )
  }
}
NOTE:

list does not rerender at all.


With whiteList:

import React, { Component } from 'react';
import IgnoreRerender from 'react-ignore-rerender';

class ExampleComponent extends Component {
  constructor(props) {
    super(props);
    this.state = {
      showTitle: true,
      showDescription: true,
    };
  }
  render () {
    const {showTitle, showDescription} = this.state;
    return (
      <IgnoreRerender whiteList={{ showTitle, showDescription }}>
        { showTitle && <h1>Title</h1> }
        { showDescription && <p>Description</p> }
      </IgnoreRerender>
    )
  }
}
NOTE:

ExampleComponent does not rerender when changing any props or state except showTitle and showDescription.


License

MIT © soroushchehresa


Support:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].