# nuke-static-component

> 静态组件

Latest version **0.0.2** (published 2017-08-30) · 0 weekly downloads

## Install

```sh
npm install nuke-static-component
pnpm add nuke-static-component
yarn add nuke-static-component
bun add nuke-static-component
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2017-08-30 |
| First published | 2017-08-30 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | 178518 |
| Maintainers | 178518 |
| Keywords | nuke, nuke-static-component |

## Links

- npm: https://www.npmjs.com/package/nuke-static-component
- Repository: git@gitlab.alibaba-inc.com:nuke/static-component
- npm.io page: https://npm.io/package/nuke-static-component

## Dependencies (1)

- [nuke-core](https://npm.io/package/nuke-core.md) ^0.x.x

## Recent versions

- 0.0.2 (latest) — 2017-08-30

## README

# StaticComponent

- category: StaticComponent
- chinese: 静态组件
- type: 组件性能优化

## 设计思路
提升组件更新时的渲染性能，shouldComponentUpdate默认返回false，要求在componentDidMount之后数据不能有任何变化。

组件开发继承原则：

- 组件挂载之后数据不变化，继承StaticComponent
- 组件挂载之后数据会变化，继承PureComponent(数据只会浅比较，组件的props尽可能扁平化。推荐使用Redux管理数据和状态)
- root节点组件，继承Component

## 使用方法
```
'use strict';
import {Component, createElement} from 'rax';
import StaticComponent from 'nuke-static-component';

class Demo extends StaticComponent {
    //your code
}

export default Demo;
```

---
_Source: https://npm.io/package/nuke-static-component · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
