Skip to main content
Filter by
Sorted by
Tagged with
2 votes
2 answers
99 views

I am a beginner in C# trying to figure out how ref-safe-context is defined in C#. I declared a function Foo which didn't work since it tries to ref assign a variable with declaration-block to a ref ...
Louis Nicolas Davout's user avatar
4 votes
1 answer
116 views

Consider this code: struct Struct { public int Num; } class Program { public void A(ref readonly Struct s) { } public void B(ref readonly Struct s) => A(ref s); } I get a compilation ...
Yaakov Shoham's user avatar
0 votes
2 answers
35 views

I have a scenario involving a 3rd party component in an array: let array = [{comp:(<Component/>)},{comp:(<Component/>)},{comp:(<Component/>)}] array.map((arElem, index) => ( <...
Neph's user avatar
  • 418
-1 votes
1 answer
86 views

Please consider the following class/method being called from a Blazor page instance class. My question is: if two threads call the MyStaticMethod concurrently passing the same ref int index reference ...
David Rosenblum's user avatar
0 votes
0 answers
41 views

I would like to disable the submit button in my Vue application if the user hasn't entered data in the donationInput input field. I'm sure I'm missing something basic, thanks for your help identifying ...
Nick Bewley's user avatar
  • 9,319
3 votes
3 answers
126 views

Given the method ref readonly State GetState(); where State is a struct, the following code accesses State.SimTime without copying State: ref readonly var state = ref GetState(); var t = state....
Arne Claassen's user avatar
2 votes
1 answer
217 views

I have a function with following signature State MoveForward(in Path path); Path is a ref struct State is also a ref struct with just integer. Now I have another helper function bool TryMoveForward(...
Vivek MVK's user avatar
  • 1,179
1 vote
1 answer
51 views

This official Vue.js documentation claims that the ref() API in Vue 3 uses getters and setters. In Vue 3, Proxies are used for reactive objects and getter / setters are used for refs. This would ...
Ahmad Shahwan's user avatar
0 votes
0 answers
187 views

The below code shows an error on the line tableItemsOptions.value.search = searchArray Error: Type 'Record<string, string | null>' is not assignable to type 'UnwrapRef<Record<keyof T, ...
Gilad Dahan's user avatar
0 votes
1 answer
85 views

I have two classes declared.Goods and User class Goods { #price: number #quantity: number constructor(price: number, quantity: number) { this.#price = price; this.#quantity =...
accbear's user avatar
  • 23
0 votes
1 answer
84 views

First of all, I understand that the ref, in and out parameters are forbidden in asynchronous tasks. However, as I have this need, I'm trying to find the cleanest, simplest and most effective solution. ...
jeheel's user avatar
  • 21
3 votes
1 answer
63 views

I am trying to understand the behavior of ref and const ref applied to the members of a composite type (e.g. record). Here, is it OK to assume that the behavior of them is similar to auto& and ...
tbzy's user avatar
  • 109
2 votes
1 answer
34 views

I am working on a schedule component in React, the relevant code is available in this code sanbox. And can be accessed here: https://6rcv9w.csb.app/ As the console logs show the touchmove event stops ...
Iván Hidalgo's user avatar
0 votes
1 answer
98 views

I am new to vue js, I am using this vue-form-wizard and I am not sure if there is a way to disable the next button by some conditions, so depends on the conditions will enable or disable the button &...
Rooh Al-mahaba's user avatar
0 votes
0 answers
120 views

I am creating a react component that creates a custom html element and sets innerhtml using dangerouslySetInnerHTML, everything goes fine but the issue arises when I provide the dynamic type to the ...
Dhiraj sah's user avatar
0 votes
1 answer
183 views

<input type="file" id="fieldBoxContentAddPhoto" accept="image/png" @input="inputPhoto(this,fieldBoxContentAddPhoto2,fieldBoxContentAddPhoto3)" > <...
MGJH's user avatar
  • 11
1 vote
1 answer
327 views

i have a component which renders conditionally and i pass a ref to it via forwardRef of React ,but when condition met and component renders, the ref still has not any value, what should i do? here is ...
Faraz's user avatar
  • 99
0 votes
1 answer
186 views

i'm trying to use custom component for ListboxComponent prop in Autocomplete MUI v5, but i'm getting this error: Function components cannot be given refs. Attempts to access this ref will fail. Did ...
Hadji Andrei's user avatar
1 vote
1 answer
199 views

I'm currently writing a lot of functions that accept blocks and expressions as input. I generally find it much easier to work with Refs, as they are simple, lightweight, and it's also easy to ensure ...
Svalorzen's user avatar
  • 5,637
1 vote
1 answer
297 views

I have a reusable wrapper component which like this: import { FC, HTMLAttributes } from "react"; const Wrapper: FC<HTMLAttributes<HTMLDivElement>> = ({ children, className, ...
Mehdi Faraji's user avatar
  • 4,094
0 votes
0 answers
177 views

I have a component like this: const ColumnTaskPrompt = () => { const promptRef = useRef<HTMLDivElement>(null); useClickOutside(promptRef, () => { console.log("do something";...
Party Favor's user avatar
1 vote
0 answers
903 views

I have tried everything. When I run this in overleaf I get (??) but I'm also able to click the (??) to get to the figure in my pdf so clearly the machine understands what I'm referencing but it doesn'...
ArvidSteen's user avatar
0 votes
1 answer
114 views

I have a component that is conditionally rendered and i don't know the height of it beforehand (and also would like to avoid setting it manually). It should automatically be equal to the size of its ...
Saltuk Kezer's user avatar
0 votes
1 answer
48 views

I have the following code: and it looks like this: I need to add a div with a reference inside it: And if I do so, all the UI moves up. See this picture: I realized this happens only when I add ...
Sonhja's user avatar
  • 8,510
0 votes
0 answers
45 views

There are two variants of ref usage in react: ref object: const CustomInput = () => { const ref = useRef(); return <input ref={ref} /> } and callback ref: const CustomInput = () => { ...
Volok's user avatar
  • 73

1
2 3 4 5
29