#issue with react router course

1 messages ยท Page 1 of 1 (latest)

void nebula
quasi gazelle
#

I don't understand what is happening?

void nebula
quasi gazelle
quasi gazelle
#

I just checked the scrim and even if I see the native code in the preview when it first loads, if you then go to "/" route (which is the home) and click on about, it renders correctly... maybe it was just a glitch?
That looked very much like server-side rendered jsx

void nebula
#

it's working fine in other scrim tysm!

quasi gazelle
#

Oh, I didn't do anything, but I'm glad you solved it. Sometimes the errors just go away like that ๐Ÿ˜‰

kindred thistle
#

The reason you were having the issue is because react and imports work weird when you have your file names for your components start with lower case letters. If you change your file name from about.jsx to About.jsx and import it in your index.jsx file as import About from './About' it will fix this issue. Change the file name and the import before clicking run on the scrimba browser and it should work. I think the scrim is a little weird when it comes to editing imports and file names. I don't know how accurate the statement is, but I do believe they are using some kind of webpack configuration or some other bundler for script bunding in react, in which case it may be looking for a component with a capital letter from it's import and not finding it. Hince the strange browser output.

royal cliff
quasi gazelle
#

@kindred thistle @royal cliff thanks for this info, I didn't know lowercase file names could cause such an issue! ๐Ÿ’ฏ

royal cliff
kindred thistle
kindred thistle