Tag: c

59 votes
28 answers
3K views
How to set focus on an input field after rendering?

What's the react way of setting focus on a particular text field after the component is rendered? Docume

avatar
Chaya
0 1 0 9
asked 07 September, 2021
59 votes
17 answers
2.2K views
How do I conditionally add attributes to React components?

Is there a way to only add attributes to a React component if a certain condition is met? I'm supposed to

avatar
Dario
0 1 0 9
asked 07 September, 2021
60 votes
30 answers
2.6K views
React js onClick can't pass value to method

I want to read the onClick event value properties. But when I click on it, I see something like this on the co

avatar
Daniel
0 1 0 9
asked 07 September, 2021
68 votes
11 answers
822 views
Why do we need middleware for async flow in Redux?

According to the docs, "Without middleware, Redux store only supports synchronous data flow". I don't und

avatar
Mikki
0 1 0 9
asked 07 September, 2021
51 votes
19 answers
689 views
Understanding unique keys for array children in React.js

I'm building a React component that accepts a JSON data source and creates a sortable table. Each of the

avatar
Wei
0 1 0 9
asked 07 September, 2021
53 votes
20 answers
2.7K views
Can you force a React component to rerender without calling setState?

I have an external (to the component), observable object that I want to listen for changes on. When the object

avatar
Nereida
0 1 0 9
asked 07 September, 2021
61 votes
30 answers
2.1K views
React-router urls don't work when refreshing or writing manually

I'm using React-router and it works fine while I'm clicking on link buttons, but when I refresh my w

avatar
Robyn
0 1 0 9
asked 07 September, 2021
62 votes
28 answers
2.7K views
How to pass props to {this.props.children}

I'm trying to find the proper way to define some components which could be used in a generic way: <Pa

avatar
Robyn
0 1 0 9
asked 07 September, 2021
59 votes
17 answers
907 views
What does the three dots notation do in Javascript?

What does the ... do in this React (using JSX) code and what is it called? <Modal {...this.props} title=&a

avatar
Carmelina
0 1 0 9
asked 07 September, 2021
55 votes
30 answers
1K views
Loop inside React JSX

I'm trying to do something like the following in React JSX (where ObjectRow is a separate component): <

avatar
Forrest
0 1 0 9
asked 07 September, 2021
54 votes
30 answers
2.9K views
Programmatically navigate using React router

With react-router I can use the Link element to create links which are natively handled by react router. I s

avatar
Hilario
0 1 0 9
asked 07 September, 2021
50 votes
5 answers
658 views
#if Not Debug in c#?

I have the line in vb code: #if Not Debug which I must convert, and I don't see it in c#? Is there

avatar
Margo
0 1 0 9
asked 07 September, 2021
56 votes
10 answers
1.5K views
Auto column width in EPPlus

How to make columns to be auto width when texts in columns are long? I use this code Worksheet.Column(colI

avatar
Eddie
0 1 0 9
asked 07 September, 2021
55 votes
12 answers
525 views
How to have comments in IntelliSense for function in Visual Studio?

In Visual Studio and C#, when using a built in function such as ToString(), IntelliSense shows a yellow box ex

avatar
Corrin
0 1 0 9
asked 07 September, 2021
64 votes
4 answers
2.1K views
Why C# fails to compare two object types with each other but VB doesn&apos;t?

I have two objects in C# and don't know if it's Boolean or any other type. However when I try to com

avatar
Jesenia
0 1 0 9
asked 07 September, 2021
66 votes
7 answers
1.7K views
How should I cast in VB.NET?

Are all of these equal? Under what circumstances should I choose each over the others? var.ToString() CStr(v

avatar
Majorie
0 1 0 9
asked 07 September, 2021
59 votes
17 answers
2K views
Mixing C# & VB In The Same Project

Can you mix vb and c# files in the same project for a class library? Is there some setting that makes it possi

avatar
Tuan
0 1 0 9
asked 07 September, 2021
54 votes
12 answers
1.4K views
Is String.Format as efficient as StringBuilder

Suppose I have a stringbuilder in C# that does this: StringBuilder sb = new StringBuilder(); string cat = "ca

avatar
Shanita
0 1 0 9
asked 07 September, 2021
54 votes
13 answers
2.8K views
.NET Configuration (app.config/web.config/settings.settings)

I have a .NET application which has different configuration files for Debug and Release builds. E.g. the debug

avatar
Fabian
0 1 0 9
asked 07 September, 2021