1,429 questions
2
votes
2
answers
107
views
how is the ref-safe-context determined in c# when ref assigning to local variables
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 ...
2
votes
2
answers
59
views
Angular CLI 18 do not accept my form nativeElement
I have a simple form and I'm using EmailJS to handle it and I'm sure my IDs and key are correct.
Here's an example of my form:
<form (ngSubmit)="sendEmail(form)" #form="ngForm"&...
4
votes
1
answer
121
views
C#/.NET: why can't I pass ref readonly variable into another method that require ref readonly variable?
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 ...
0
votes
1
answer
87
views
How to use NSubstitute with void function and ref argument?
I'm new on C# and NSubstitute - I've been having a rough time trying to mock a avoid function and that it has a ref argument. I've been trying a combination of these docs and these docs (as well as ...
0
votes
2
answers
36
views
Modifying refs in an array
I have a scenario involving a 3rd party component in an array:
let array = [{comp:(<Component/>)},{comp:(<Component/>)},{comp:(<Component/>)}]
array.map((arElem, index) => (
<...
0
votes
0
answers
92
views
In the nim-lang, I want to pass a ref to a read-only tree structure to the spawn'ed nim-taskpool
Sorry for the long message, but I was wondering if you could give me some advice.
What I want to achieve is to handle tree-structured data in the nim language using tasks with the nim-taskpool package....
-1
votes
1
answer
89
views
Is a reference parameter in a static method in a static class in C# .NET thread-safe?
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 ...
0
votes
0
answers
72
views
PointerToNowhere Exception when validating CRDs using OpenAPI Schema Validator
I have tried creating a schema and validating yaml file structures based on their datatype and I have been constantly getting the same error no matter how I try to resolve it.
The source code where I'...
0
votes
0
answers
43
views
Disabling Form Submit Button Vue3
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 ...
0
votes
1
answer
73
views
Reset File Input Refs Across Components to Allow Re-uploading
I only came across very hacky solutions, so maybe someone has a better idea how to solve it.
Here's what I'm trying to do:
The UploadComponent lets the user select files using refs.
Once a file is ...
3
votes
3
answers
133
views
Does accessing a field on a struct returned by ref copy the struct?
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....
2
votes
1
answer
241
views
CS8347/CS8352 with "ref struct" and "in" / "ref" parameter
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(...
0
votes
1
answer
175
views
How do you type the refObject of a dynamic tag element in React Typescript?
This issue keeps reoccurring and I always seem to code around it so I'm hoping someone out there can help me shed some light on the correct way to type this.
function MyComponent({ isCondition }): ...
1
vote
1
answer
57
views
Identity checks with ref values in Vue3 not working as expected
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 ...
0
votes
0
answers
53
views
Uncaught TypeError: Cannot read properties of undefined (reading 'refs') in React Js using NX monorepo
Getting this error while closing the modal from closeModal component. I have written path replace using history.push() function.
Ex.
const OnClose = () =>{
history.push({
pathname: "/...