+ 9
How to work with elements, not indexes in react components?
When I try to apply filter method to my items in Worked and NotWorked components nothing happens. Look at these components into <ul> tags. I made some examples of comments after filter function: "When I try..." https://code.sololearn.com/W8Ir6co9nUex
6 Respuestas
+ 10
ODLNT
Thanks! It's so strange coz I tried items.props.children too, but it didn't work. But now I got what I need👍 Thank you, mate, one more time.
+ 9
Calviղ
I tried filter items as strings and nothing happened too...
+ 4
Try
items.filter((item, idx) => {
return item.props.children !== 'ADA' && item.props.children !== 'LISP'
})
+ 2
It's a html string, not a dom element yet, so innerText has no effect on it.
+ 2
4rontender
I'm glad you are up and running.
Keep an eye out for those pesky (items)👀
Good coding.
- 1
Hi