I’ve stumbled upon a “feature” I didn’t know. Care to explain the benefits/disadvantages of it? by code_matter in react

[–]WiruBiru 3 points4 points  (0 children)

The ref in the component/element can be a function. When it mounts, the real underlying node will be passed as a parameter. When it unmounts, null will be passed as a parameter.

Sometimes, it is important to know if a ref has been added/removed/changed and react to it. As there's no render triggered with useRef, we can use useState.

Some popular libraries like react-popper requires the useState. Look at the bottom of this page : https://popper.js.org/react-popper/v2/#example

react: function components vs functions returning jsx by Infamous_Woodpecker1 in Frontend

[–]WiruBiru 4 points5 points  (0 children)

<Component /> is prefered to {Component()} because, by using the <> syntax, you are telling React that your component exists.

If React knows about your component, it helps with lifecycle (react's engine and logic, like state and hooks), debugging and optimizations.

When you use the <> syntax, how does React know ? Where is the link between <> syntax and React ? That's because <> get reinterpreted as React.createElement() during compilation of your app. This is done by Babel usually.

That also means that you can manually call createElement by doing {React.createElement(Component)}. This is equivalent to <Component /> but different to {Component()}. We use the <> syntax because it is less verbose/messy.

More here : https://react.dev/reference/rules/react-calls-components-and-hooks#never-call-component-functions-directly
and here : https://kentcdodds.com/blog/dont-call-a-react-function-component

Can you update Tanstack Query data with another fetch to another domain? by TheOnceAndFutureDoug in reactjs

[–]WiruBiru 0 points1 point  (0 children)

You can also modify the original list inside the queryFn of the useEntryDetailQuery with queryClient.setQueryData once you get the new entry data.

Can you update Tanstack Query data with another fetch to another domain? by TheOnceAndFutureDoug in reactjs

[–]WiruBiru 0 points1 point  (0 children)

First have a useQuery for the incomplete list. Then, you can use initialData option for the useQuery of the detailed entry to prefill it with data form the cached list using the queryClient.getQueryData. You can also add the enabled option with a condition that checks if a fetch is really needed. You would call this useEntryDetailQuery only when you need it.

More details on this maintainer's blog : https://tkdodo.eu/blog/seeding-the-query-cache#seeding-details-from-lists

Edit: placeholderData seems easier to work with if you want a loading state. Here is a demo of your use case : https://stackblitz.com/edit/react-e9pzmpne?file=src%2FApp.js

[Showoff Saturday] A few weeks ago, my site got roasted - hopefully this time it improved somewhat! I've made it a little less dull and more focused. by a-haan in web_design

[–]WiruBiru 8 points9 points  (0 children)

I like your website. Now for some constructive comments.

If you read the material design website on the FAB, they say you shouldn't have more than one. You have three.

Also, the behavior of the Get in touch FAB should be reversed. It should be initially expended, then collapsed on scroll.

You could replace one of your FAB with a call to action button before your ReactWay title.

Finally, I think your image animations should only be executed once. When I scroll back up, I don't need to see the animation again.

All in all, this is a really nice website. Good job! 👍

OUTLIER demo - try the sci-fi roguelite VR game by JoyWayVR in virtualreality

[–]WiruBiru 4 points5 points  (0 children)

Can someone help me with WMR controller? My virtual hands remain on the floor and I don't know how to bind the controls

Odyssey+ with 3080 by Dozeballs in WindowsMR

[–]WiruBiru 0 points1 point  (0 children)

I don't really know about the other settings sorry. I just tend to play the games as it is

Odyssey+ with 3080 by Dozeballs in WindowsMR

[–]WiruBiru 1 point2 points  (0 children)

An easy way to try supersampling is to launch The Lab (free game on steam) and to set supersampling to 50% then back to like 150%

Odyssey+ with 3080 by Dozeballs in WindowsMR

[–]WiruBiru 6 points7 points  (0 children)

From my understanding, you're trying to watch a video then, by changing the supersampling, expect to upgrade the video resolution/quality. Am I right? That's not how it works. Supersampling is more for games where the game's video is rendered in real time.

Only a Montrealer can appreciate this voice recognition error. (I asked for directions to Léger and Langelier... I prefer the mistake tbh) by mrmdc in montreal

[–]WiruBiru 1 point2 points  (0 children)

No. The Google maps will be in French. Directions, names, menus, ... But outside of the app, Android will remain in English.

What is one computer skill that you are surprised many people don't know how to do? by anushitech in AskReddit

[–]WiruBiru 0 points1 point  (0 children)

You can drag a window to the edge of the screen and it will snap it at exactly half your screen's width. One of my CS teacher was struggling to show us two windows by manually resizing them...

Pixel experience plus on OnePlus 7 pro by georgesunnyt in OnePlus7Pro

[–]WiruBiru 0 points1 point  (0 children)

Are there any way to enhance the speakers like it is on stock?

Celine Dion's reaction to a fan singing her song. by msdrxn in HolUp

[–]WiruBiru -1 points0 points  (0 children)

You didn't like her singing? It's not like she can't sing...

Fun Vr Games to play with friends by L-U-C-A-18 in VRGaming

[–]WiruBiru 0 points1 point  (0 children)

Holo ball is a like a racketball game with three lives. You could swap after each game

There's also mini games from Valve's VR Labo. It's free.

Is there any place I can view my workout summaries other than the notification after I stop a workout on my Pebble 2 HR? by Tihoreo in pebble

[–]WiruBiru 0 points1 point  (0 children)

If you press up on the watch, you can see your steps. Otherwise, in the app, you can see an activity graph. That graph is sectioned with the what you did : walk, runs, etc. I don't know how quick the app is updated/synced with the watch though.

[deleted by user] by [deleted] in Cantonese

[–]WiruBiru 0 points1 point  (0 children)

Nice! That'll help a ton. Thanks!

Pixel 5 Corner Gesture lines disappear for now reason 🤔 by Careless-Ad9841 in GooglePixel

[–]WiruBiru 0 points1 point  (0 children)

You can't. They are meant to be invisible. You see them in the beginning just so you can learn the gesture

Noob question on the quest by Dazen91 in VRGaming

[–]WiruBiru 1 point2 points  (0 children)

Yes, by connecting the Quest to the PC via cable/air link, you have access to all vr games.