anikethsaha / mern

:tada: This is boilerplate for MERN stack with integrations like Redux and SSR :tada:
https://mern.netlify.com
MIT License
98 stars 44 forks source link

Feat/styled component #114

Closed wincentrtz closed 4 years ago

wincentrtz commented 4 years ago

This is what i have done:

anikethsaha commented 4 years ago

You can now make changes in your local machine and then push it to your branch itself. Thos will be reflected here automatically

wincentrtz commented 4 years ago

Actually there's no hello.js in this commit

I move it into a hello folder and put index.js and style.js inside. I guess that's better and it will make our import statement shorter too.

But if we want to keep it as hello.jsx, we can create a folder called styled with same level with test,

This is the current structured: image

This is the structured I suggest if we want to keep file name as hello.jsx: image

What do you think @anikethsaha ?

anikethsaha commented 4 years ago

Ohh sorry, my bad...I meant index.js -> index.jsx ? No, you can keep it index itself ...the folder name hello looks good....we can keep everything related to that in that folder like tests and all 👍

wincentrtz commented 4 years ago

If we change it to index.jsx i guess there'll be a problem for javascript import statement. Where they can't detect index.jsx itself.

This is our previous import statement: image We dont need to specify index.js at the end of import statement, because it's index.js

but when we're using jsx i'm facing this kind of issue image and we need to add index.jsx at the end of import statement is it okay?

anikethsaha commented 4 years ago

Yea I faced that too. Actually I changed all components to jsx and added .jsx at the end of the imports. I don't know why it's like that maybe some error in placing babel plugin. Ok, you can leave it as it is. No need to change it for now. Add some styles to the div (container) https://github.com/anikethsaha/MERN/pull/114#discussion_r334224775 and then we are good to go for merging it 👍

wincentrtz commented 4 years ago

Awesome then! I have pushed the new one @anikethsaha

Please check it once more :)

Thank you

anikethsaha commented 4 years ago

@all-contributors please add @wincentrtz for code

allcontributors[bot] commented 4 years ago

@anikethsaha

I've put up a pull request to add @wincentrtz! :tada: