React Component不会发出事件

时间:2016-09-28 15:54:22

标签: javascript node.js reactjs

我无法使这个简单的反应组件发出事件。我有一个输入字段,我在其中显示DOM的值。这是我到目前为止所得到的,我无法弄清楚错误,控制台没有记录任何错误,这就是为什么我这么困惑..

//// Server.js

/tmp/kafka-logs

/// Main.js(编译为bundle.js的那个)

const express = require('express');
const app = express();
const webpack = require('webpack');
const webpackMiddleware = require('webpack-dev-middleware');
const config = require('./webpack.config.js');
const compiler = webpack(config);
const server = require('http').Server(app);
const io = require('socket.io')(server);

app.use(webpackMiddleware(compiler, {publicPath:config.output.publicPath}))
app.use(express.static(__dirname + '/src'))

io.on('connection', socket => {
    socket.on('message', data => io.emit('message', data))
})

server.listen(3000, () => console.log('server is up!'))

任何可能帮助我弄明白的帮助或git都会有所帮助,ty!

0 个答案:

没有答案