Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
iansinnott committed Feb 4, 2016
1 parent 23579cc commit 27c2779
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 15 deletions.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Highlight Strings
# Highlight Numbers

A simple example of using `reactReplaceString` to highlight numbers in a rendered text string.
A very simple example of using `reactReplaceString` to highlight numbers in a rendered text string.

**Quick Start:**

Expand Down
1 change: 1 addition & 0 deletions example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const HighlightNumbers = React.createClass({
render() {
return (
<div>
<h1>Highlight Numbers</h1>
{reactReplaceString(this.props.content, /(\d+)/g, (match, i) => (
<span key={i} style={{ color: 'red' }}>{match}</span>
))}
Expand Down
3 changes: 0 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
"devDependencies": {
"babel": "^5.8.34",
"babel-core": "^5.4.7",
"babel-eslint": "^4.1.6",
"babel-loader": "^5.1.2",
"babel-plugin-react-transform": "^1.1.1",
"express": "^4.13.3",
"react": "^0.14.3",
"react-dom": "^0.14.3",
Expand All @@ -23,7 +21,6 @@
"redbox-react": "^1.2.0",
"webpack": "^1.12.9",
"webpack-dev-middleware": "^1.4.0",
"webpack-hot-middleware": "^2.6.0",
"react-string-replace": "*"
},
"dependencies": {}
Expand Down
2 changes: 1 addition & 1 deletion example/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ app.use(require('webpack-dev-middleware')(compiler, {
publicPath: config.output.publicPath,
}));

app.use(require('webpack-hot-middleware')(compiler));
// app.use(require('webpack-hot-middleware')(compiler));

// Send the boilerplate HTML payload down for all get requests. Routing will be
// handled entirely client side and we don't make an effort to pre-render pages
Expand Down
11 changes: 2 additions & 9 deletions example/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable no-var */
/* eslint-disable no-var, prefer-template */
var path = require('path');
var webpack = require('webpack');

Expand All @@ -10,16 +10,10 @@ var webpack = require('webpack');
// https://github.com/glenjamin/webpack-hot-middleware/issues/37
var DEV_PORT = process.env.DEV_PORT || 3000;
var DEV_HOST = '//localhost:' + DEV_PORT + '/';
var HMR_HOST = DEV_HOST + '__webpack_hmr';

module.exports = {
devtool: 'inline-source-map',

entry: {
app: [
'webpack-hot-middleware/client?path=' + HMR_HOST,
'./index.js',
],
app: './index.js',
},

output: {
Expand All @@ -29,7 +23,6 @@ module.exports = {
},

plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
],

Expand Down

0 comments on commit 27c2779

Please sign in to comment.