1,466 karma · joined May 23, 2012
I'm aware some of the React community use hooks, some of us still use classes. Classes provide a better interface when dealing with state that is shared between parent and child. This is a write up much better than I can explain: https://react-redux.js.org/api/hooks#stale-props-and-zombie-...
import React, { Component } from 'react'
class ManualStateComponent extends Component {
state = {
now: null
}
constructor(props) {
super(props)
}
// Since you don't want to call `setState`, here is a method with the name you prefer
rerender() {
this.setState({
now: Date.now()
})
}
}
// Example Component
class SimpleTimer extends ManualStateComponent {
constructor(props) {
super(props)
this.seconds = 0 // Just a plain variable
}
componentDidMount() {
setTimeout(() => {
this.seconds++;
this.rerender() // rerender!
}, 1000)
}
render() {
return <div>{this.seconds} secs have elapsed...</div>;
}
}
gist: https://gist.github.com/chrisabrams/9e140d212098033365a76666...Here is a React/WebGL game I made which tracks a lot of variables and state, but does not use redux/flux...because it's 100% possible to make even make a 3D game with React without them!!!
It is 100% possible to build large React apps without redux/flux. There are entire ecosystems built around, say Mobx, among many other libraries and tools which don't even follow the flux style patterns.
> The example on the website uses closures to handle component state
I'm not asking about component state; I'm asking how do multiple components access app-wide state. I can't use a singleton for that; how do I know when that singleton is updated? I guess I could use a proxy but I don't want to do that.
> and to let users pick their desired level of complexity.
React is the view layer. It doesn't enforce any type of data layer or state management layer.
What should a developer do that needs to share state across a Forgo app?
It would be awesome if browsers just had a real template language like JSX, we'd see more "web components" which are just a little bit of JSX/or whatever templates and some DOM APIs. Developers are tired of managing binding and unbinding events. React does that well. I assume Fargo does too.
So putting aside the redux/flux paradigm, what else is the real hurdle being solved?
In what universe is this an acceptable analogy for anything?
Edit: Make sure to include the quote.
If you capped how much banks could loan on guarantee, you’d see prices for schools drop pretty sharp. Mark Cuban has talked about this a bunch over the years.
I really do think that a 13 or 15 inch MacBook Pro 2 in 1 like the Dell xps would sell pretty well...
[edit] fixed spell check
How often would a carrier get shot on the deck? Would the carriers be farther back than other ships?
As someone who has taught children how to do html/css/ basic JS it’s amazing to see how they progress; the creativity a child can have is unpredictable but usually inspiring.
Also, why is pocket acting like amp with the url? :/ :/ :/
The experience of a WeWork and Regus are very different. They can both co-exist because some people like a more community type environment, and some people just want a modular space that is affordable.
WeWork tried a bunch of things that you might not find at a typical coworking space but I personally would pay 2x for a WeWork space over the same Regus space because I will get more value out of the WeWork space which is meeting people. I have spent plenty of time in my career in WeWork and Regus spaces, and WeWork has been much more fruitful in terms of the network effect.
Make sure that your company's interview process leaves enough time at the end of each interview to allow the candidate to ask questions. Don't assume the candidate is OK with emailing questions later because you only left the candidate 3 minutes to talk. The candidate pledged a day of their life to interview as they are interested in your company. If they leave your company at the end of the day without being able to ask all the questions they have, there's a chance they will never bring them up later.
With software, many parts of the business can't "see" the development happening, so they don't know why it would take so long. At the same time, unlike a boat or building, software is more likely to be easily modified. Therefore there is less of a risk to get it all right initially. I do not condone said behavior I am merely pointing out a possible scenario in which it could happen.
It is also true that a developer is more likely to be a push over than a general contractor. Source: 11 years as as software engineer and my family has been involved with land and real estate for a long time.
[edit]: spellcheck failed.
Technologies: TypeScript, JavaScript, React, Node.js, Docker, Kubernetes, PostgreSQL, Google Cloud Platform, Stellar Blockchain, Ethereum Blockchain, Bitcoin Lighting Network
Résumé/CV: https://www.linkedin.com/in/cabrams/
Email: mail [at] chrisabrams.com
I generally work as a technical lead or architect helping companies build JavaScript applications, API, & SDKs and I do a lot of work with NASA.
My specializations include single page apps, scalable Node.js-backed APIs, JavaScript SDKs, and reliable infrastructure powered by Kubernetes. Repeat clients appreciate my abilities to break down & organize projects as well as hit the finish line.
Remote: Yes
Willing to relocate: Nope
Technologies: TypeScript, JavaScript, React, Node.js, Docker, Kubernetes, PostgreSQL, Google Cloud Platform, Stellar Blockchain, Ethereum Blockchain, Bitcoin Lighting Network
Résumé/CV: https://www.linkedin.com/in/cabrams/
Email: mail [at] chrisabrams.com
I generally work as a technical lead or architect helping companies build JavaScript applications, API, & SDKs and I do a lot of work with NASA.
My specializations include single page apps, scalable Node.js-backed APIs, JavaScript SDKs, and reliable infrastructure powered by Kubernetes. Repeat clients appreciate my abilities to break down & organize projects as well as hit the finish line.