在你自己的hosts文件里加上映射, 然后再改下config.js
里面的host,
跟你在hosts映射名字统一。
node ./injured.js
import React, { Component } from 'react'; | |
import ReactDOM from 'react-dom'; | |
class Getter extends Component { | |
firstAndLastName() { | |
return `${this.props.firstName} ${this.props.lastName}`; | |
} | |
get fullName() { | |
return `${this.props.firstName} ${this.props.lastName}`; |
const http = require('http'); | |
const config = require('./config'); | |
const port = config.port.injured; | |
const host = config.host; | |
http | |
.createServer((req, res) => { | |
console.log(req.headers.cookie); | |
res.writeHead(200, { | |
'Set-Cookie': host |
yarn
yarn build:notruntime > path/to/file
It will be clear to understand the flow of webpack.
import React, { Component } from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { createStore, applyMiddleware } from 'redux'; | |
import { connect, Provider } from 'react-redux'; | |
import createSagaMiddleware, { delay } from 'redux-saga'; | |
import { put, takeEvery, all } from 'redux-saga/effects'; | |
function* incrementAsync() { | |
yield delay(1000); | |
yield put({ type: 'INCREMENT' }); |
class Slider extends Component{ | |
renderPlugins(){ | |
let { children } = this.props; | |
let dataModel = {...this.props,...this.state}; | |
return do{ | |
if(typeof children=='function'){; | |
children(dataModel) | |
}else{ | |
children; | |
} |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
class Issue3926 extends React.Component { | |
constructor() { | |
super(); | |
this.handleChange = this.handleChange.bind(this); | |
this.handleComposition = this.handleComposition.bind(this); | |
this.onComposition = false; | |
this.state = { |
if ('serviceWorker' in navigator) { | |
navigator.serviceWorker | |
.register('./sw.js') | |
.then(function(registration) { | |
const interval = setInterval(() => { | |
try { | |
registration.installing.postMessage({ | |
'api.github.com/users/monkindey': {} | |
}); | |
} catch (err) { |