+ This is the equivalent LaunchDarkly React example project using hooks. The message above changes the greeting,
+ based on the current feature flag variation.
+
+
+ {showShinyNewFeature ?
+ : ''}
+
+
+ {showShinyNewFeature ? 'This button will show new shiny feature in UI on clicking it.': ''}
+
+
+ );
+};
+
+export default HooksDemo;
diff --git a/nodejs/react-cypress-launchdarkly-feature-flag-test/src/universal/siteNav.js b/nodejs/react-cypress-launchdarkly-feature-flag-test/src/universal/siteNav.js
new file mode 100644
index 0000000..7ac8e51
--- /dev/null
+++ b/nodejs/react-cypress-launchdarkly-feature-flag-test/src/universal/siteNav.js
@@ -0,0 +1,16 @@
+import React from 'react';
+import { css } from 'styled-components';
+import { Link } from 'react-router-dom';
+
+export default () => (
+
+ Home
+ Hooks Demo
+
+);
diff --git a/nodejs/react-cypress-launchdarkly-feature-flag-test/webpack.config.client.js b/nodejs/react-cypress-launchdarkly-feature-flag-test/webpack.config.client.js
new file mode 100644
index 0000000..284abb9
--- /dev/null
+++ b/nodejs/react-cypress-launchdarkly-feature-flag-test/webpack.config.client.js
@@ -0,0 +1,27 @@
+const path = require('path');
+
+const WebpackServeUrl = 'http://localhost:3002';
+
+module.exports = {
+ mode: 'development',
+ devtool: 'source-map',
+ entry: ['@babel/polyfill', './src/client/index'],
+ output: {
+ path: path.resolve('dist'),
+ publicPath: `${WebpackServeUrl}/dist/`, // MUST BE FULL PATH!
+ filename: 'bundle.js',
+ },
+ module: {
+ rules: [
+ {
+ test: /\.jsx?$/,
+ include: path.resolve('src'),
+ exclude: /node_modules/,
+ loader: 'babel-loader',
+ options: {
+ cacheDirectory: true,
+ },
+ },
+ ],
+ },
+};
diff --git a/nodejs/react-cypress-launchdarkly-feature-flag-test/webpack.config.server.js b/nodejs/react-cypress-launchdarkly-feature-flag-test/webpack.config.server.js
new file mode 100644
index 0000000..7074e60
--- /dev/null
+++ b/nodejs/react-cypress-launchdarkly-feature-flag-test/webpack.config.server.js
@@ -0,0 +1,28 @@
+const path = require('path');
+const nodeExternals = require('webpack-node-externals');
+
+module.exports = {
+ mode: 'development',
+ devtool: 'source-map',
+ entry: ['@babel/polyfill', './src/server/server.js'], // set this to your server entry point. This should be where you start your express server with .listen()
+ target: 'node', // tell webpack this bundle will be used in nodejs environment.
+ externals: [nodeExternals()], // Omit node_modules code from the bundle. You don't want and don't need them in the bundle.
+ output: {
+ path: path.resolve('dist'),
+ filename: 'serverBundle.js',
+ libraryTarget: 'commonjs2', // IMPORTANT! Add module.exports to the beginning of the bundle, so universal-hot-reload can access your app.
+ },
+ // The rest of the config is pretty standard and can contain other webpack stuff you need.
+ module: {
+ rules: [
+ {
+ test: /\.jsx?$/,
+ include: path.resolve('src'),
+ exclude: /node_modules/,
+ loader: 'babel-loader',
+ options: {
+ cacheDirectory: true,
+ },
+ }],
+ },
+};
\ No newline at end of file