News for hackers. Stuff that matters.
Re:How Does setState Know What to Do? by parhamn on Sunday December 09, 2018 @09:42AM (#18641043)
> If you start by following most react tutorials, they will make you begin with something way more complicated that it needs to be and you will get discouraged.

Can't agree more with this. There are quite a few reasons I think those starter-kits and tutorials are very harmful especially to new developers. Figuring out how your tsconfig/webpack/babelrcs/state-handlers/etc all fit together should be something that should certainly be done and learned incrementally.

Perhaps the issue is the amount of boilerplate you need to start a simple app. There should be a flask[1] like starter for react/vue apps. Parcel seems like the closest thing but its still not obvious to me why they demo 4 files to get started [2] -- we already dynamically transforming and compiling everything why not just have a single `index.js` with a Index/Main entrypoint?

Is there anything out there to do something as simple as:

    import * as React from "react"
    import {Html, Body, Title} from "parcel"

    const Index = () => {
        return (
            <Html>
            <Title>MySite</Title>
            <Body>
                <h1>Hello world!</h1>
            </Body>
            </Html>
        )
    }
with a `cmd {run,build} index.{jsx,tsx}`

[1] https://github.com/pallets/flask/#a-simple-example

[2] https://parceljs.org

Re:How Does setState Know What to Do? by petetnt on Sunday December 09, 2018 @10:50AM (#18641374)
Create React App does pretty much with all the complexity hidden behind ’react-scripts’ you can optionally eject out of if needed sometime in the future.

The steps are pretty much

npx create-react-app && yarn start and finally yarn build for a production ready build.

Re:How Does setState Know What to Do? by sametmax on Sunday December 09, 2018 @05:10PM (#18643613)
Using "Create React App" as a beginer is the best way to have no idea of what you are doing, and make terrible decisions for what follows next.
Re:How Does setState Know What to Do? by petetnt on Sunday December 09, 2018 @05:44PM (#18643796)
I'd love if you would elaborate on that so the Create React App documentation[0] and the official recommended tutorial[1] could be improved on

[0]: https://facebook.github.io/create-react-app/ [1]: https://reactjs.org/tutorial/tutorial.html

edit: Saw your points above and while I do not agree I can understand your point of view.

Re:How Does setState Know What to Do? by sametmax on Monday December 10, 2018 @05:52AM (#18646903)
I already contribute to the python community. No time for another one, sorry.