# react-hotify

> A generic library implementing hot reload for React components without unmounting or losing their state.

Latest version **0.1.1** (published 2015-04-28) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install react-hotify
pnpm add react-hotify
yarn add react-hotify
bun add react-hotify
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2015-04-28 |
| First published | 2015-04-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 452 |
| Author | Dan Abramov |
| Maintainers | gaearon |

## Links

- npm: https://www.npmjs.com/package/react-hotify
- Repository: https://github.com/gaearon/react-hotify
- Issues: https://github.com/gaearon/react-hotify/issues
- npm.io page: https://npm.io/package/react-hotify

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^3.7.0

## Recent versions

- 0.1.1 (latest) — 2015-04-28
- 0.2.0-alpha (next) — 2015-05-15
- 0.1.0 — 2015-04-28

## README

React Hotify
=========

This project is a successor of [React Hot API](https://github.com/gaearon/react-hot-api).  
It has less features and is much less mature.

For now, use at your own risk.  
Read [The Death of React Hot Loader](https://medium.com/@dan_abramov/the-death-of-react-hot-loader-765fa791d7c4) for some context.

### Usage

Annotate component classes with the [decorator](https://github.com/wycats/javascript-decorators) this library exports.
The decorator accepts one parameter: **a string uniquely identifying the given component class in your application.** It should persist between the live edit reloads. For example, you can use the module filename concatenated with the class name.

You should generate these decorator calls (e.g. with a [Babel plugin](https://babeljs.io/docs/usage/plugins/)) so users don't have to write them.

### Examples

#### Webpack

```js
import React from 'react';
import hotify from 'react-hotify'; // Your tool should generate this

@hotify(`${module.id}-Other`) // Your tool should generate this
class Other {
  render() {
    return (
      <h1>hmm.</h1>
    );
  }
}

@hotify(`${module.id}-App`) // Your tool should generate this
export default class App extends React.Component {
  render() {
    return (
      <Other />
    );
  }
}

// Opt-in to Webpack hot module replacement for the module
module.hot.accept(); // Your tool should generate this
```

#### Browserify

???

### Tests

This time, [we've got tests!](https://github.com/gaearon/react-hotify/blob/master/src/__tests__/makeHotify-test.js)

```
npm install
npm test
```

### License

MIT

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