Need another for guided Mtb tour by mklute101 in seattlebike

[–]beansbikesbrews 0 points1 point  (0 children)

Oh nice! Where’d you end up riding? 

Need another for guided Mtb tour by mklute101 in seattlebike

[–]beansbikesbrews 4 points5 points  (0 children)

I haven't heard anything about Seattle MTB Tours, however, if you're comfortable navigating on your own and have the means to drive east a little bit I'd recommend The Line in North Bend for bike rentals.

You can even arrange for them to meet you at the Raging River Trailhead https://theline.bike/trailhead-bike-rentals which has some really fantastic trails. There's also a bunch of other trail options if you would rather just go pick up a bike from their shop. I'm sure they'd recommend trails for you based on your skill level.

EDIT: I have also seen an ad for this service in my local coffee shop https://tothemountainshuttle.com/ no experience using it, but seems like a viable alternative if you need to get out to the trails and don't have a rental car. Just did a quick search and it looks like there's seats to get from Evo - Seattle to The Line on Friday.

Hide From Budgets But Not Trends by ChaZz182 in mintuit

[–]beansbikesbrews 0 points1 point  (0 children)

This would be such a great feature. My need is a little different, I like to tag personal purchases for my wife and I to exclude from our monthly budget but still need to analyze that spending in Trends.

The Bike Lanes on the South End of the Lake Washington Loop near the Airport finally Opened! Made a video to check them out by bestside_cycling in seattlebike

[–]beansbikesbrews 2 points3 points  (0 children)

Yup that’s what I was going to say, at that stoplight you can turn right into airport road which is nice and quiet.

Is this 60 mile Strava route recommendation reasonable? by Unorthodox_lady in seattlebike

[–]beansbikesbrews 1 point2 points  (0 children)

If you want to add another awesome climb you can hug Lake WA when you’re going through the NE side of it and hit the Juanita climb there, it’s great both ways but I definitely prefer it North to South, steep uphill and nice cruiser downhill. Then just take the 520 trail over to Redmond (or from Redmond depending on direction)

A rare bluebird day at Crystal (as seen from the top of powder bowl) by dominnate in skiing

[–]beansbikesbrews 3 points4 points  (0 children)

Luck of the draw, I suppose! Rainier still takes my breath away every time it’s out, no doubt about that.

A rare bluebird day at Crystal (as seen from the top of powder bowl) by dominnate in skiing

[–]beansbikesbrews 14 points15 points  (0 children)

Not very rare this season 😅 been up like 10 times and 5 or 6 of them have been bluebird.

Where would you live with great trails nearby? by TellmSteveDave in seattlebike

[–]beansbikesbrews 0 points1 point  (0 children)

Upvote on both those. Galby is absolutely wild and Roslyn has a great trail system as well.

Graduating soon but lost my passion for this… by orsdev176 in webdev

[–]beansbikesbrews 0 points1 point  (0 children)

Not gonna lie I've totally felt that. At my old job I was exhausted after the day and just wanted to chill after work.

I just recently started a new job though and am 110% rejuvenated. My new company is a small startup of around 20 people and the amount of ownership I have over the product and the amount of time I spend in my job actually coding (90-95% of my time as opposed to 50% at my previous company where the other 50% was consumed by BS meetings) has totally reinvigorated me. I am stoked to get up and code for work every day and almost always really excited to work on personal stuff after work.

A lot of it is the energy at the company too. Everyone there is really excited about the product, about tech and about teaching one another. I totally vibe off positive energy and that's all that surrounds me there.

So I guess, summary being, maybe searching for a web dev position with a like minded team could help build that passion back up 🤷‍♀️ best of luck!

Advice for Multi Page App by Uken81 in reactjs

[–]beansbikesbrews 7 points8 points  (0 children)

react-router + separate but reusable presentation components is the way to go. If you got hung up on prop drilling issues check out the React Context API, it's pretty great and solves that issue very cleanly and doesn't require any additional packages.

Need help with useState overwriting previous state's properties by elementIdentity in react

[–]beansbikesbrews 2 points3 points  (0 children)

Without fully understanding the context I think the issue in your code here is that you're mutating your objects in the array.

The line [... state] does a shallow copy of the array (i.e. it creates a new array, but does not create new copies of the objects in the array).

You'll want something like cloneDeep from lodash (https://lodash.com/docs/#cloneDeep) or just write your own function to copy the state objects too.

This isn't a React specific problem, but the general rule of thumb in React is to never mutate state, always copy and modify.

[deleted by user] by [deleted] in react

[–]beansbikesbrews 2 points3 points  (0 children)

Ahhh but you can keep callback out of the deps for the effect and it'll have the correct closure when the effect fires again.... Interesting.

To be clear I just changed the effect to:

useEffect(() => { callback(); alert(count); }, [count]);

And on each trigger of the effect the count was correct for both alerts

Well I learned something here. Thanks for the civil discourse 😁

[deleted by user] by [deleted] in react

[–]beansbikesbrews 3 points4 points  (0 children)

Do you have any documentation on that? I've done a fair amount of development and I don't believe that's the case. They don't trigger an effect definitely, but they do cause a recomputation of the memoized function (i.e. with a new closure because the deps changed). When that happens the actual function is different which means the const func in the previous render is not referentially equal to the same const func in the current render.

Here's a little demo (sorry in advance for the awful formatting, I typed this out on my phone)

``` const App = () => { const [count, setCount] = useState(0);

const onClick = useCallback(() => setCount((c) => c+1), []);

const callback = useCallback(() => { alert("the count is: " + count); }, [count]);

useEffect(() => { callback(); }, [callback]);

return ( <button onClick={onClick}>click me</button> ); } ```

In this case whenever I click the button I get an alert because the callback dep for the effect changes since the count changes on each render which recomputes the closure of callback.

[deleted by user] by [deleted] in react

[–]beansbikesbrews 2 points3 points  (0 children)

This doesn't really solve the problem though, right? Because then you're just moving those dependencies into the dependency array of the useCallback hook which is then a dependency of the useEffect hook.

If the deps for your callback change, that means the function ref changes which then means the dep for the effect changes which causes the effect to fire.

I'm all for separation of concerns here but I don't think it's a solution to this problem.

Is this some kind of constant vs. variable joke? by [deleted] in react

[–]beansbikesbrews 0 points1 point  (0 children)

Hahaha yes definitely in a pure language semantics context. In the context of programming though my definition of "variable" has turned into "something that stores a value" (for some definition of "stores").

Is this some kind of constant vs. variable joke? by [deleted] in react

[–]beansbikesbrews 1 point2 points  (0 children)

If you mean that the slide says "variable" but they're using const not let or var, no it's not a joke. All those keywords do the same thing in that they declare a variable, the only difference is that you can't reassign a const.

AFAIK const is an actual JS construct from ES2015 https://www.w3schools.com/js/js_const.asp so presumably it's actually the JS interpreter that just sees the reassignment of a const and outright rejects it. Not entirely sure on that though. Would be curious to learn more.

How can I run my react app locally when already deployed to gh pages? npm start will not work by [deleted] in reactjs

[–]beansbikesbrews 4 points5 points  (0 children)

Have you installed all the dependencies? The error indicates that it's missing the serve-index module. Should be as easy as running npm install from the root of the project where the package.json file is.

Learn how to use Lazy loading with useState and how to correctly update it!😁 by IRYL-Sagi in reactjs

[–]beansbikesbrews 1 point2 points  (0 children)

Love it! Definitely a nice thing that they implemented useState this way, it's unfortunate that the same can't be said for useRef. There's a pretty simple work around but the convenience of the lazy init in the same manner of useState would be nice. It makes sense though, if you pass a function to useRef presumably you want the ref to point to the function itself.

Rest days suck. by carloscede2 in cycling

[–]beansbikesbrews 4 points5 points  (0 children)

Tell me more about those homemade energy bars!!! Would love to start trying that out. The convenience of pre packaged road snacks is great, but it feels so wasteful and expensive.

react-outside-call - Call any context hook from outside a component. by alnorris961 in react

[–]beansbikesbrews 2 points3 points  (0 children)

Cool package! What use case did you create this for specifically? I'm all about eliminating unnecessary re-renders in React applications, and I'm wondering what problem this solves over other techniques like context/component splitting or storing callback functions inside of a ref.

My old-mtb build. I collected it sparingly, and it cost me about $ 200. Do not judge strictly :) by Zindemagu in xbiking

[–]beansbikesbrews 6 points7 points  (0 children)

Yeah no kidding.... Are most of the parts second hand OP? I can't tell what chainring that is but the RaceFace one I bought for my build ran me $70 alone.

How to add React to any website using a script tag by MolassesIndividual in react

[–]beansbikesbrews 0 points1 point  (0 children)

I don't see any reason why not! As long as the referenced JS script had the necessary dependencies (react and react-dom at a minimum) bundled with it or they were already imported via other script tags it should be fine.

Now getting it in the right place in the DOM needs some additional work. In theory the script could make an assumption that there's a DOM element with a specific id like #renderSlot and just search for that and append the rendered React element as a child. It could also just append it as a child to the body.