react-hot-boilerplate

Minimal live-editing example for React

Github星跟蹤圖

A Big Update Is Coming

React Hot Loader 3 is on the horizon, and you can try it today (boilerplate branch, upgrade example). It fixes some long-standing issues with both React Hot Loader and React Transform, and is intended as a replacement for both. The docs are not there yet, but they will be added before the final release. For now, this commit is a good reference.

React Hot Boilerplate

The minimal dev environment to enable live-editing React components.

⚠️⚠️⚠️ This Is Experimental and Incomplete! ⚠️⚠️⚠️

This is not a good starting point for people learning React.
It’s experimental and completely lacks any production features.

Do not use this as an actual project boilerplate!
If you’re just getting started with React, use Create React App instead.

Usage

git clone https://github.com/gaearon/react-hot-boilerplate.git
cd react-hot-boilerplate/
npm install
npm start
open http://localhost:3000

Now edit src/App.js.
Your changes will appear without reloading the browser like in this video.

Linting

This boilerplate project includes React-friendly ESLint configuration.

npm run lint

Using 0.0.0.0 as Host

You may want to change the host in server.js and webpack.config.js from localhost to 0.0.0.0 to allow access from same WiFi network. This is not enabled by default because it is reported to cause problems on Windows. This may also be useful if you're using a VM.

Missing Features

This boilerplate is purposefully simple to show the minimal configuration for React Hot Loader. For a real project, you'll want to add a separate config for production with hot reloading disabled and minification enabled. You'll also want to add a router, styles and maybe combine dev server with an existing server. This is out of scope of this boilerplate, but you may want to look into other starter kits.

WebStorm

Because the WebStorm IDE uses "safe writes" by default, Webpack's file-watcher won't recognize file changes, so hot-loading won't work. To fix this, disable "safe write" in WebStorm.

Dependencies

Resources

主要指標

概覽
名稱與所有者gaearon/react-hot-boilerplate
主編程語言JavaScript
編程語言HTML (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2014-08-24 00:38:09
推送於2020-08-21 23:47:32
最后一次提交2020-08-21 23:47:31
發布數3
最新版本名稱v1.0.0 (發布於 )
第一版名稱v0.1.1 (發布於 )
用户参与
星數3.9k
關注者數103
派生數870
提交數99
已啟用問題?
問題數84
打開的問題數12
拉請求數32
打開的拉請求數2
關閉的拉請求數25
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?