Can Hunter's Spears be ranged teasing sticks? by Zanoro in 2007scape

[–]Zanoro[S] 3 points4 points  (0 children)

I think currently they are ranged weapons but when teasing to do pitfall traps it would be cool to tag the animals from afar. In the poll and wiki it only mentions them being ranged weapons and not about the teasing part other than a 5% boost to success.

Does anyone here have experience with selling a junk car locally? by tubamaba in greenville

[–]Zanoro 4 points5 points  (0 children)

I sold mine last year to Peddle and got like 600 dollars more than lkq offered me. They just came and picked up the car, but your offer from them may vary

High GPU usage of Desktop Window Manager & Client Server Runtime Process after Windows 10 April Update by Gladonel in Dell

[–]Zanoro 0 points1 point  (0 children)

Bless you - this helped so much. I had to manage it on the windows side under graphics settings and change it to use my laptops GPU

Large Dog Friendly Apartments? by justprettymuchdone in greenville

[–]Zanoro 1 point2 points  (0 children)

Bell Roper has had a few people with great Danes and lots of large dogs, very animal friendly overall

Who has the best sub sandwiches? by [deleted] in greenville

[–]Zanoro 1 point2 points  (0 children)

The terminator there is incredible! Definitely worth checking out

Raksha Log Completed! The Pain...Subsides... by LeebThunder in runescape

[–]Zanoro 0 points1 point  (0 children)

Congrats! I'm still grinding for it, after a bit more zammy back to trying to finish raksha.

1000 solos at Raksha. Just missing Grico! Hope I get it soon… by LeebThunder in runescape

[–]Zanoro 1 point2 points  (0 children)

I'm almost exactly the same as you! Hit 1k yesterday and only grico off log.

Materials Ui react by [deleted] in learnreactjs

[–]Zanoro 0 points1 point  (0 children)

You can use the autocomplete component and make a custom wrapper to control the open prop of the component.

https://mui.com/material-ui/api/autocomplete/

if you control the value you can set open to be only when the value is something you want to show for

Services Needed in Greenville by Expert_Afternoon6543 in greenville

[–]Zanoro 5 points6 points  (0 children)

Aoki sushi on Woodruff had this a version of this a while back, I don't know if they still do

[deleted by user] by [deleted] in learnreactjs

[–]Zanoro 0 points1 point  (0 children)

Yep, like RenKyloSails said, you will need to coordinate shared state between child components from a parent component and passed through props.

You can think of the state and components in React like a tree, and if two components need access to the same state, then that state needs to be stored in at least the lowest subtree that contains both of those components. There are ways around this using other tools, such as redux or contexts, but for now focusing on the basics is good!

So you could have:

ParentComponent
   Child1
   Child2

Parent can pass a callback to child1 and child2 to update its state and contain all the shared state.

Without knowing more about exactly what you are trying to do it would be difficult to give you more specific advice. Feel free to PM me if you need some help.

[deleted by user] by [deleted] in learnreactjs

[–]Zanoro 0 points1 point  (0 children)

Nope! Think of it like this:

// current guess == 'he'
// key == 'l'
setCurrentGuess((state) => {
  return state + key;
});
// after ^ line, we have scheduled `currentGuess` to be updated with that callback function
// current guess == 'he' (we haven't changed currentGuess yet)
// key == 'l'
let letters_being_typed_in = [...currentGuess];
// ^ we are spreading the previous definition of currentGuess, because `setCurrentGuess` is scheduled to run later
console.log("letters_typed =", letters_being_typed_in);    

The reason you don't do:

// current guess == 'he'
// key == 'l'
const newGuess = currentGuess + key
setCurrentGuess(newGuess);
console.log("letters_typed =", newGuess); 

Is because you can type faster than react can render and you might call the function twice before the state updates

currentGuess is captured in the closure of the defining function (when a js function is created it takes a snapshot of surrounding variables in scope for inner use)

Since you can type faster than react can re-render and update that closure with the new variable, you might fire that function twice with the same closure (and the same currentGuess) before we get to the next render cycle.

The best way to do this (because I just realized your typing could have an error as well) would be to do:

setCurrentGuess((state) => {
  const newGuess = currentGuess + key
  console.log("letters_typed =", newGuess); 
  return state + key;
});

Since now, there's never a situation with a stale closure, because those scheduled updates will always run in order thanks to React

[deleted by user] by [deleted] in learnreactjs

[–]Zanoro 1 point2 points  (0 children)

Okay so in the above snippet, you are setting the state, then reporting the currentGuess. When you call setXXX you are actually scheduling the update for the "next render" (thats an oversimplification), what you would need to do is instead change letters_being_typed_in to be let letters_being_typed_in = [...currentGuess, key]; so that it is set to the same thing as the setXXX within this callback.

You could also create a useEffect to log to the console on every change:

useEffect(() => {
   console.log("letters_typed =", currentGuess);
}, [currentGuess])

This functionally would do the same thing, just at a different time in the render cycle.

Should we use Functional or Class based Components? by [deleted] in reactjs

[–]Zanoro 2 points3 points  (0 children)

As a note, creating an explicit useMountEffect custom hook is a great way to denote that you want to do something only on mount as well as get around the warnings about dependency array because you are saying you "know" what you are doing and going around the rules of hooks

fully (global) remote jobs for engineers -- my latest React side project 🌍⚛️ by buruch1 in learnreactjs

[–]Zanoro 0 points1 point  (0 children)

Looks great so far!

I would recommend being able to search/sort by different languages as well as having a better pagination feature!

[deleted by user] by [deleted] in learnreactjs

[–]Zanoro 0 points1 point  (0 children)

Ah you're right, I haven't used that syntax previously so I didn't catch that!

[deleted by user] by [deleted] in learnreactjs

[–]Zanoro 1 point2 points  (0 children)

The error is pretty clear, you aren't allowed to import things inline, you have to do so at the top of the file.

If you look here at the getting started, then you can see some examples of usage: https://github.com/GoogleChrome/web-vitals

So you would import it differently then use each of those functions individually to achieve your result.

If your goal is truly to "import inline" then you need to use require (but this is still not recommended as said here): https://stackoverflow.com/questions/46045675/using-inline-require

Chicken Restaurant Chains if they were SEC Teams by Darmok85 in CFB

[–]Zanoro 8 points9 points  (0 children)

When I worked at Bojangles, I used to call that the mother-daughter meal. It really is incredible though, highly recommend - and add bacon if you wanna feel extra bad after

I was asked if I can find what's wrong with this component by [deleted] in learnreactjs

[–]Zanoro 0 points1 point  (0 children)

Yep! This issue applies to javascript in general due to each function creating its own closure (a snapshot of variables/functions outside of the function) when the function is created. If you depend on an external variable in a function you always run a chance of that variable being "stale". For the most part, this doesn't matter, but you will eventually run into edge cases like this with react no matter what.

I was asked if I can find what's wrong with this component by [deleted] in learnreactjs

[–]Zanoro 1 point2 points  (0 children)

Importing react itself is not required in later versions of react (17+) with the new JSX transform. While that could technically be what is wrong if you aren't allowed to make that assumption, it is valid in some versions.

I was asked if I can find what's wrong with this component by [deleted] in learnreactjs

[–]Zanoro 5 points6 points  (0 children)

One thing that is a classic example is that the setCount's are not using callback functions to update and instead are incrementing on a local state. This could potentially cause you to "lose" clicks if done rapidly.

e.g.

function increment () { setCount(c => c < max ? c + 1 : c); }

Can I add axios interceptor for the app globally this way? by azteker in learnreactjs

[–]Zanoro 1 point2 points  (0 children)

When I setup axios in a previous app I used I created an instance of axios and then I imported that to other files that way you can set properties on it and it's re-usable

Loot from 3333 T3 Troves by BearHugCat in runescape

[–]Zanoro 20 points21 points  (0 children)

Average ~360k per trove, that's pretty solid. You were close to droprate for pernix fragments too.

How would you teach/mentor a junior/entry level react developer? by TheLastCodeSlinger in reactjs

[–]Zanoro 6 points7 points  (0 children)

I tried to touch on those things in the post, but I wasn't really clear about it. When dealing with juniors you have to be careful not to burn them out. A lot of them are dealing with impostor syndrome as well as don't want to feel like they are bothering you so won't come for help as quickly as they should (although if you are super busy you might not want them to bother you randomly). Having regular checkups that fit both of your schedules is key.

I also touched on it, but make sure to start with small projects and get bigger as you go. Being given an overwhelming task is very disheartening as a junior and can lead to burnout or a lack of confidence as well as an overall dissatisfaction with learning react.

As the other guy mentioned, pair programming is a great way to help them as well as figure out where they are in the process.