Is there any need for this...
-
-
-
Probably not, if you don’t have it
কথা-বার্তা শেষ
নতুন কথা-বার্তা -
-
-
Hi
@dan_abramov, Are there any more benefits to this decision other than reducing lines of code, and consequently, the complexity of state logic in your component? If so what could the benefits be? -
Might be easier to test, or to reuse similar stateful logic across several components. I don't think this *reduces* lines of code btw — on the contrary, it gives names to things. I would probably do something similar when state logic becomes non-trivial and buggy for a component.
-
Also... `actions` is static (i.e. not a method of the component) so the memory footprint is smaller. I mean not in this case, as you only have one instance of `App`, but for other components, yes.
-
Aren’t methods on ES6 classes prototypes?
-
Yes: class { foo() {} } No: class { foo = () => {} }
-
“Demystifying Memory Usage using ES6 React Classes”
@donavonhttps://medium.com/dailyjs/demystifying-memory-usage-using-es6-react-classes-d9d904bc4557 …
কথা-বার্তা শেষ
নতুন কথা-বার্তা -
-
-
There absolutely is a need for this.. it's called "making it click" for someone new to React.
-
But don't most React tutorials teach the library's built-in state management?
-
Most React Docs, from what I read, teach us to mix state into our view layer using class instances. The Docs don't really recommend a progressive strategy for state management. Initially it is pretty ad hoc, just keep it in components and pass it around. Maybe add Context later.
-
The next option is one that people mostly discover through related readings, which is to put state into Redux or MobX. It would be great to see progression in app design explained in the Docs, from ad hoc React beginnings to fully structured architectures, even if only diagrams.
-
The way we think about is that we want to make it easier to integrate complex stateful logic with components rather than to teach people to use other libraries. In other words, it's not a matter of fixing the docs — it's a matter of improving React.
-
Ah.. ok, could you expand on those improvements

..I know, maybe to much to ask right now
Will React make it easier for devs to implement pure functions passing data structures, as an option to the established method of sharing props between stateful components?
কথা-বার্তা শেষ
নতুন কথা-বার্তা -
-
-
Relevant tweet in my feed:https://twitter.com/samccone/status/1018953104568602624?s=19 …
ধন্যবাদ। আপনার সময়রেখাকে আরো ভালো করে তুলতে টুইটার এটিকে ব্যবহার করবে। পূর্বাবস্থায়পূর্বাবস্থায়
-
-
-
No redux is the best redux
-
How can this replace Redux ?! I see just separating stateful logic from the component with a very clean and legible code. But I didn't get how can it affect Redux.
-
It's like single-reducer redux, except dispatch is setState, actions are functions which mutate the state itself. So instead of a single big shared state you'd have multiple smaller, local states. You'd load data in the components and store the result only as high as you need
-
It was tongue-in-cheek, a more accurate joke would be: It's like redux for keeping state to yourself. Also splitting state like this would be a mad PITA when you had to shuffle it around. I wonder if you could have a Context with different states you could affect from anywhere
-
Wanted to build it but thankfully someone has already made something similar:https://github.com/drcmda/react-contextual …
কথা-বার্তা শেষ
নতুন কথা-বার্তা -
লোড হতে বেশ কিছুক্ষণ সময় নিচ্ছে।
টুইটার তার ক্ষমতার বাইরে চলে গেছে বা কোনো সাময়িক সমস্যার সম্মুখীন হয়েছে আবার চেষ্টা করুন বা আরও তথ্যের জন্য টুইটারের স্থিতি দেখুন।