File tree Expand file tree Collapse file tree 4 files changed +24
-11
lines changed Expand file tree Collapse file tree 4 files changed +24
-11
lines changed Original file line number Diff line number Diff line change 11import 'babel-polyfill' ;
22import React from 'react' ;
33import ReactDOM from 'react-dom' ;
4- import { ParallaxTest } from 'components' ;
5- import { ParallaxController } from 'react-scroll-parallax' ;
6-
7- ParallaxController . init ( ) ;
4+ import { App } from 'components' ;
85
96const root = document . getElementById ( 'root' ) ;
107
11- ReactDOM . render ( < ParallaxTest /> , root ) ;
8+ ReactDOM . render ( < App /> , root ) ;
Original file line number Diff line number Diff line change 1+ import React , { Component } from 'react' ;
2+ // import PropTypes from 'prop-types';
3+ import { ParallaxProvider } from 'react-scroll-parallax' ;
4+ import { ParallaxTest } from 'components' ;
5+
6+ export default class App extends Component {
7+ render ( ) {
8+ return (
9+ < ParallaxProvider >
10+ < ParallaxTest />
11+ </ ParallaxProvider >
12+ ) ;
13+ }
14+ }
Original file line number Diff line number Diff line change 11export ParallaxTest from './ParallaxTest/ParallaxTest.js' ;
2+ export App from './App/App.js' ;
Original file line number Diff line number Diff line change @@ -4,23 +4,24 @@ import express from 'express';
44
55import React from 'react' ;
66import ReactServer from 'react-dom/server' ;
7- import { ParallaxTest } from 'components' ;
7+ import { App } from 'components' ;
88
99import 'babel-polyfill' ;
1010
11- const app = express ( ) ;
11+ const server = express ( ) ;
1212
13- app . use ( '/static' , express . static ( path . resolve ( __dirname , './dist' ) ) ) ;
13+ server . use ( '/static' , express . static ( path . resolve ( __dirname , './dist' ) ) ) ;
1414
15- app . get ( '*' , ( req , res ) => {
15+ server . get ( '*' , ( req , res ) => {
1616 const html = fs
1717 . readFileSync ( path . resolve ( __dirname , './index.html' ) )
1818 . toString ( ) ;
19- const markup = ReactServer . renderToString ( < ParallaxTest /> ) ;
19+
20+ const markup = ReactServer . renderToString ( < App /> ) ;
2021
2122 res . send ( html . replace ( '$react' , markup ) ) ;
2223} ) ;
2324
24- app . listen ( 3000 , ( ) => {
25+ server . listen ( 3000 , ( ) => {
2526 console . log ( 'Listening on: http://localhost:3000' ) ;
2627} ) ;
You can’t perform that action at this time.
0 commit comments