ec changed the topic of #elliottcable to: a π•―π–Šπ–“ 𝖔𝖋 π•―π–Šπ–™π–Šπ–—π–’π–Žπ–“π–Šπ–‰ π•―π–†π–’π–˜π–Šπ–‘π–˜ slash sΝ”ΜžuΝ•Ν™pΝ™Ν“e̜̺rΜΌΜ¦i̼̜oΜ–Μ¬rΜ™Μ™ c̝͉α»₯Μ§Ν˜αΈ·Μ‘Ν™Ε£Ν“Μ€ || #ELLIOTTCABLE is not about ELLIOTTCABLE
Rurik has quit [Quit: Rurik]
Sgeo_ has joined #elliottcable
Sgeo__ has quit [Ping timeout: 240 seconds]
_whitelogger has joined #elliottcable
Rurik has joined #elliottcable
_whitelogger has joined #elliottcable
Rurik has quit [Quit: Rurik]
Rurik has joined #elliottcable
Rurik has quit [Quit: Rurik]
<ec> anybody use Linux on the desktop and got a second to try something for me? I've spent all goddamn day banging my head against VMware and Linux Mint and apt-get and open-vm-tools and all I goddamn want is to run a few git commands
<ec> someone be lovely and try this for me on their machine? because my git checkout is failing on Travis, but only on the Linux workers, and I can't fucking figure out why
<ec> th'fuck kind of API is this
<ec> `const [loading, setLoading] = useState(true);`
<ec> @jfhbrook
<jfhbrook> ec: it's react hooks :) and yeah it's super whacky but I kinda like it
<jfhbrook> ec: the way they work is that useState has access to a closure where it tracks the state, and it depends on controlling the lifecycle of the component to know which component is active for any given hook (basically)
<jfhbrook> ec: but it's a replacement for the this.setState pattern, end of day
<jfhbrook> oh, but I can give your linux thing a shot later, I'm going home very soon
<ec> I don't know the this.setState pattern; I don't use React
<ec> jfhbrook: that'd be very nice, yes
<ec> having a linux nightmare today
<jfhbrook> ec: so the way react components work is *waves hands* react holds onto a tree of components and re-instantiates them when it decides it needs to re-render - and rendering in the first place is due to immutable "props" and highly mutable "state", but the way it manages state using the OG class API is that the React.Component class has a method called setState that you use instead of manually modifying self.state
<jfhbrook> so when you call self.setState() it triggers react to recalculate its virtual DOMitude or whatever
<jfhbrook> hooks are an alternate API that let you return a function rather than a Component with a render() method
<jfhbrook> but it's all the same shit, just a more clever/weird API
<jfhbrook> by "re-instantiate" for Components I actually meant re-render - for hooks it has to call the "component function" instead
<ec> lol k
<ec> react is all greek to me but whadduh I know
<jfhbrook> yeah, this is all new to me too
<jfhbrook> after years of "eventually" I decided that I wanted to make an App
<ec> people are all on about props at conferences and I just tune out until they get back to the good stuff :P
<jfhbrook> and now I have a little react app that I'm enjoying
<jfhbrook> react is decent
<jfhbrook> the community is kinda dumb and there is a *lot* of really dumb shit built around it, like react-router and redux and I mean realistically you need webpack and babel now too
<jfhbrook> total circus to get up and running
<jfhbrook> but once you have it going it's alright
<jfhbrook> if you wanna play w/ this try https://nextjs.org/learn/basics/getting-started
<jfhbrook> it's like a canned thing, made by the zeit team, pretty solid tutorial, easy to get dirty
<ec> lol
<ec> see what you just called a β€œcircus” is the bit I understand and/or care about :P
<ec> know plenty about webpack etc; it’s just frontend that’s greek
<ljharb> jfhbrook: you need a bundler and a transpiler for modern web dev no matter your stack
<jfhbrook> yeah didn’t mean to imply different
<ljharb> (not that i like webpack)
<jfhbrook> oh man I can't figure out how to set up this API!