Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 02 - React doesn't take effect page 22 #21

Open
Andersrapp opened this issue Nov 19, 2015 · 9 comments
Open

Chapter 02 - React doesn't take effect page 22 #21

Andersrapp opened this issue Nov 19, 2015 · 9 comments

Comments

@Andersrapp
Copy link

I run into problem on page 22. It says the html page should be empty and I should open developer tools to find an empty h1-tag. My page is not empty and shows the original text ("I am about to learn the essentials of React.js.") from the index.html file. It hasn't been written over by app.js or anything.

If I run the downloaded code it works fine and shows three list items instead of the original text but I haven't gotten to the end yet. So I tried to copy the code from the example files (except for app.js and snapterest.js) and build again with gulp. I still get the same result. Gulp finishes and I can see the snapterest file is updated. The only difference I can find now is in the versions of babelify and browserify in packages.json. I tried changing them as well and build again. Still no change.

So React doesn't even kick in....

@k-dahl
Copy link

k-dahl commented Nov 28, 2015

I ran into this same issue and it came down to changes made in babelify v7 from v6. So, you can fix it by either using babelify 6.2.0 as in the git repo here, or you can run:

npm install --save-dev babel-preset-react

And modify this line in your gulpfile:

.transform(babelify)

To be this:

.transform('babelify', {presets: ['react']})

...and you should then be good to go on the v7 release of babelify.

@semanio
Copy link

semanio commented Dec 5, 2015

@blitzd thanks! I just verified that this fixes the issue.

@mmizutani
Copy link

@blitzd, thanks for the tip!

@fedosejev
Copy link
Owner

@blitzd thanks for supporting your fellow readers!

@edconnor
Copy link

Works for me. Thanks!

@mregensberg
Copy link

v7 will require something similar to get the later (jsx) tests working as well. I added a .babelrc file for this with:

{
  "presets": ["react"]
}

to get the jsx in the test specs to work correctly.

@racl101
Copy link

racl101 commented Feb 3, 2016

@blitzd Thank you kindly for the fix sir! Good Karma for you!

@MaynardTool
Copy link

thanks, it worked!

@octopustail
Copy link

@blitzd Thank you for the tip!
谢谢~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants