Posts by Ajeet Shah • 121 points
3 posts
-
0
votes1
answer243
viewsA: Property 'filter' does not exist on type 'Setstateaction<Never[]>'
You can just write it down using any[]: type Props = { text: string, todos: any[], setTodos: (todos: any[]) => void } Or you can write interface ITodo as: interface ITodo { id: number name:…
-
1
votes1
answer203
viewsA: How to redirect to an external url using React useEffect?
You cannot redirect to an external URL using react-router - Link, Redirect or history.push. But you can do it: window.location.href = 'https://www.linkedin.com/feed/' or…
-
0
votes1
answer65
viewsA: How to add a specific key to an array object?
You can do it this way: Read Stone, paper and scissors for rules. We can create a rulesObject: const rules = { "rock paper": "paper", "paper rock": "paper", "rock scissors": "rock", "scissors rock":…
javascriptanswered Ajeet Shah 121