829 questions
0
votes
1
answer
201
views
How can I map on a list that returns a tuple?
MRE:
MyType = MyDataCtor [MyType] | MyDataCtor2 MyType MyType | ... other cases (none of which require the map operation)
foo :: Type1 -> Type2 -> (Type1, Type2)
For example, for the ...
-1
votes
1
answer
101
views
React Native Warning: Each child in a list should have a unique "key" prop. in JavaScript map function [duplicate]
I am not able to get rid of it with this warning
Warning: Each child in a list should have a unique "key" prop.
Here is the complete code:
const App = () => {
const userList = [
{
...
1
vote
2
answers
86
views
How to Return Total of the month based on dates in JavaScript(React)
I wrote a hook to calculate sales based on month-to-set data for the chart.
It works fine, but I'm not satisfied.
is there a different or easy way to avoid repeating and make code clean and extendable?...
-1
votes
1
answer
109
views
Correct use of Javascript map function [duplicate]
I am trying to use map function in my code, but I am afraid that I am making some silly mistakes. It just does not work!
Here is my code. I have 2 buttons captioned "ID" and "Text"....
1
vote
0
answers
135
views
image don't render in react (django + react with vite project )
Hello I'm trying to develop a blog using django as a backend and react on the frontend. i've written a map function on the frontend to loop through the blog articles, all other field elements appears ...
0
votes
3
answers
133
views
Checking content of a map function inside return section of React js
How can I check in React if a map function is empty or not inside the return section? wanna check If it's empty, if so render an empty array, otherwise wanna render everything by mapping the content. ...
1
vote
1
answer
83
views
How do I display an array object in map onClick for modal?
I'm fairly new to React and I'm using NextJS. I have an array with role objects. I'm mapping over the array to display role name and description. What I'm trying to do is display the other array ...
0
votes
1
answer
64
views
how to apply useEffect and map function without repeat more than one a time
I have a component in react native that gets data from mongodb
const Num = () => {
console.log("how many times do you see this message?")
const [data, setData] = useState([])
...
0
votes
3
answers
111
views
TypeError: uniqueCategories.map is not a function
I'm new in Next and Typescript and can't solve the issue, I have tried all possible options that found in the internet and thinking maybe the problem is that the answers were old and something have ...
0
votes
1
answer
279
views
A way to mutate a new column in every dataframe in a list of dataframes?
I have a list of files that I want to import as tibbles, then mutate a new column onto each tibble based on an ifelse statement for a threshold. I didn't want to use a loop, so I have been trying to ...
1
vote
1
answer
116
views
TypeError: data.map is not a function in react and django
I'm using Axios to retrieve data from the backend. When I log the data to the console, it appears as an object. However, I need the data to be in an array format. When I try to use the map function on ...
0
votes
1
answer
754
views
is map function is not working in next js 13.4.17 or above
i am using next js 13.4.19. i have made a GET api and trying to access the data available at mongodb database. but when i try to map the data it shows me error
Error: data?.map is not a function.
This ...
1
vote
1
answer
52
views
how to change value on nested list use map function in R
Need help I have nested list, I would like to change all the value of the photo become empty list, the list are below :
df <- list(messaging = list (telegram = list (registered = 'true', photo = c(...
0
votes
1
answer
43
views
React .map doesn't work while trying to set data for displaying on the chart
I want to display data from API on the chart and I know how to do it but I have error while using .map function. I want to separate prices[0]from prices [1] to have access to two of them because my ...
0
votes
1
answer
131
views
How to return the correct data in a map() function in react-native
When I input data into my Text input, it goes into this array
WorkoutItems([...workoutTextItems, workoutText, setsText])
I want to get my data individually from each item, so for example, workoutText ...