Git Product home page Git Product logo

Comments (4)

Can-Sahin avatar Can-Sahin commented on May 2, 2024

so any example of what you are suggesting? Hooks are everywhere in this boilerplate. I don't understand what you suggest. Can you elaborate?

from react-boilerplate-cra-template.

ajf-ajf avatar ajf-ajf commented on May 2, 2024

I think this is related to #61 -- the Dan Abramov article people recommend for structuring apps with components and containers has updates at the top and bottom where he says he no longer recommends the distinction, and that it's largely irrelevant since React introduced hooks.

I'm not new to react, but I am looking at some alternatives before restructuring an app that has outgrown its original structure (and shifting to typescript for the same reason).

To start with, I didn't know what this project intended by the division until I looked at the placeholder code and messed around with a generated example of each. People use containers and components in so many different ways that clarifying it here might help.

Correct me where I'm wrong (and if I am wrong, then it's not just the authors of #64 and #61 who aren't sure), but something like this in the docs might help explain what this project means:

  • components => independent and reusable elements, mostly UI stuff, that don't need their state preserved (buttons, styled text, a custom styled drop down menu, whatever); and,
  • containers => more complex app elements that might have state, extensive logic, and other stuff going on.

FWIW, I'm thinking of structuring that app along the lines of the last scenario here: https://www.robinwieruch.de/react-folder-structure
AFAICT, there's nothing preventing me from doing that with this setup, and I could even use the generator to create the containers, then drag-n-drop them in VS code to where I want them nested and fix up any references that VS Code doesn't automagically fix.

from react-boilerplate-cra-template.

Can-Sahin avatar Can-Sahin commented on May 2, 2024

Here its roughly mentioned already with a link in the docs saying the you can bend the structure as well.

Folder structure is an example and doesn't dictate anything. Normally in my projects I change the structure according to the logic of the web app all the time. The generators are easily updatable and testable. I will write more details to the section in the link above to clarify more though.

from react-boilerplate-cra-template.

Can-Sahin avatar Can-Sahin commented on May 2, 2024

I am thinking of leaving container component structure behind. Will take this into consideration. Thank you

from react-boilerplate-cra-template.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.