From ffda8b259bd4841cc6d67a9fcd1c3f55f2d8f52a Mon Sep 17 00:00:00 2001 From: Toni Dezman Date: Fri, 28 Jul 2017 10:52:25 +0200 Subject: [PATCH] adds Redux and changes to index.jsx page --- app/javascript/packs/settings/index.jsx | 2 +- app/views/layouts/application_react.html.erb | 3 +++ package.json | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/javascript/packs/settings/index.jsx b/app/javascript/packs/settings/index.jsx index 97d81cfd1..885d96e53 100644 --- a/app/javascript/packs/settings/index.jsx +++ b/app/javascript/packs/settings/index.jsx @@ -12,6 +12,6 @@ const Settings = () => ( document.addEventListener('DOMContentLoaded', () => { ReactDOM.render( , - document.body.appendChild(document.createElement('div')) + document.getElementById('root') ) }) diff --git a/app/views/layouts/application_react.html.erb b/app/views/layouts/application_react.html.erb index d9c938e10..578ae111d 100644 --- a/app/views/layouts/application_react.html.erb +++ b/app/views/layouts/application_react.html.erb @@ -12,6 +12,9 @@ <%= favicon_link_tag "favicon-48.png", type: "image/png", size: "48x48" %> +
<%= javascript_pack_tag 'settings/index' %> diff --git a/package.json b/package.json index 37a3b78e0..f0e5b5d46 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "rails-erb-loader": "^5.0.2", "react": "^15.6.1", "react-dom": "^15.6.1", + "react-redux": "^5.0.5", "resolve-url-loader": "^2.1.0", "sass-loader": "^6.0.6", "style-loader": "^0.18.2",