I have a simple react app with 2 components. On the left, there's a devExtreme list and on the right, there's a 'detail' pane. When I click an item in the list, I set a 'selectedItem' variable which is used by the right pane to show detail about this item. Now react rerenders - as it should - every time I change this variable (every time I click an item in the list). Now the list itself gets rerendered too so I lose the selection in the list. How should I tackle this problem? Thx you can find the code here:
Asked
Active
Viewed 41 times
0
-
Please share your working code so far so help can be provided in context – Ash Feb 01 '23 at 08:02
-
I will create a code example! – Dany Dhondt Feb 01 '23 at 09:06
-
you can find the code here: https://codesandbox.io/s/khz6h0?file=/src/App.js – Dany Dhondt Feb 02 '23 at 09:05
-
I found out that removing the line `searchExpr={["text"]}` resolves the problem, but why? – Dany Dhondt Feb 02 '23 at 09:06