ashwin3005 / password-generator

Password generator made with React
MIT License
20 stars 38 forks source link

refractor: Making src/*.js code more slimmer and simpler #7

Closed MoonLGH closed 1 year ago

MoonLGH commented 1 year ago

Checkmark

List Changed

netlify[bot] commented 1 year ago

Deploy Preview for create-your-password ready!

Name Link
Latest commit 72e2742e2d3ff902ed2d6f76ac991365cec4c07e
Latest deploy log https://app.netlify.com/sites/create-your-password/deploys/633c3f00a8375c000a43ccc9
Deploy Preview https://deploy-preview-7--create-your-password.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

ashwin3005 commented 1 year ago

Thanks a lot for your contribution.

ashwin3005 commented 1 year ago

Can you explain the purpose of removing the App.js file?

MoonLGH commented 1 year ago

umm, why not let me ask you this, why are you making a file (let's just call it file A) that just import from TextArea.js and export it, so another file (let's call it file B) can import from file A, that is just the same thing as importing TextArea.js directly to file B

MoonLGH commented 1 year ago

or like this

a.js

export const x ="hello world"

b.js

import x from "./a.js"
export x

c.js

import x from "./b.js"
//actually using the x here

then what the purposes of b.js if you can directly import from a.js

ashwin3005 commented 1 year ago

oh, Now it's clear..

But why do they provide App.js by default in create-react-app?

MoonLGH commented 1 year ago

well, this is my assumption, app.js on create-react-app is used if you had more than 1 component to render, so if you had like component from, a b c d, you can mix them in app.js so index.js just import 1 component from app.js but in this scenario, app.js only import 1 component, so why not just put it inside index.js

ashwin3005 commented 1 year ago

Now It's clear. thank you..