Tag: reactjs

51 votes
19 answers
686 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
904 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