On Monday, January 13, 2020 at 1:04:46 PM UTC-5, jake wrote:
>
> That looks like a babel problem, you are not transforming the jsx. Post 
> your babel config file.
>
> On Mon, Jan 13, 2020 at 10:20 AM fugee ohu <fuge...@gmail.com 
> <javascript:>> wrote:
>
>> app/javascript/packs/index.js
>>
>> import React from 'react'
>> import ReactDom from 'react-dom'
>> import App from '../components/App'
>>
>> document.addEventListener('DOMContentLoaded', () => {
>>    ReactDom.render(
>>       <App/>,
>>       document.body.appendChild(document.createElement('div')),
>>    )
>> })   
>>
>> I get this error:
>> SyntaxError: .../packs/index.js: Unexpected token (7:6)
>>
>>     5 | document.addEventListener('DOMContentLoaded', () => {
>>     6 |    ReactDom.render(
>> >  7 |       <App/>,
>>        |       ^
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ruby on Rails: Talk" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to rubyonra...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/rubyonrails-talk/24a278c2-d548-424c-adc2-730b687240bb%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/rubyonrails-talk/24a278c2-d548-424c-adc2-730b687240bb%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
I installed react using yarn I got it working by installing react with 
webpacker:install:react since webpacker is what I'm using makes more sense 
I guess, so also I guess I can remove the yarn react packages that I 
installed? 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/08f14316-ac33-41dc-a9ec-4984a6e13912%40googlegroups.com.

Reply via email to