Questions tagged [react-tsx]

A TypeScript XML syntax transform recommended for use with React.

TSX is an embeddable XML-like syntax. It is meant to be transformed into valid JavaScript, though the semantics of that transformation are implementation-specific. TSX rose to popularity with the React framework, but has since seen other implementations as well. TypeScript supports embedding, type checking, and compiling TSX directly to JavaScript.

563 questions
-1
votes
1 answer

Array.indexOf isnt a function

The app i made is a movie website that shows movies based on your search. You can also add favorites, however its not linked to your profile. So the solution i came up with was to make another value in the profile initial state in redux. export…
FunkeMunk
  • 1
  • 3
-2
votes
1 answer

Display Google Static maps API response in React

Currently trying to use googles statics maps api to generate an image from a polyline. The polyline is from Strava's API's. This can be done with the following code: const response = await…
-2
votes
1 answer

Type 'HTMLCollection | undefined' must have a '[Symbol.iterator]()' method that returns an iterator

I don't know what I am missing out here. I am following a tutorial in building a custom date-picker using a web component here https://www.youtube.com/watch?v=g1Zd0Y7OJuI&t=723s and am translating the JavaScript logic to Typescript. I have reached a…
Klem Lloyd Mwenya
  • 388
  • 1
  • 6
  • 17
-2
votes
4 answers

getting [] when set a useState interface array

I'm trying to set a useState variable using an interface inside a createContext. The goal is fetch some data inside someArray and added into a useState. The following code uses react with typescript: import { createContext, useState } from…
cris.sol
  • 161
  • 1
  • 1
  • 10
-2
votes
2 answers

Is it possible to run TypeScript and JavaScript in the same react app?

I have created an app in JS react. To continue my work i have come up with a file in TSX. What should I do ? Can I import a TSX file and interact with it whithin a JSX file ? Should I transform my whole app to TSX for it to work ?
RouckyKM
  • 85
  • 1
  • 8
-2
votes
1 answer

how to send a parameter from a file to another in react

I'm building a pokedex website and I have pokemon cards with some data displayed in them from a JSON file and when you click on one of them you have a modal view that appears with more detailed data. So in the modal view I want only the detailed…
Random Dev
  • 47
  • 4
-3
votes
7 answers

frontend fetch data for react with ts

example that school teached us store data and use of interfaces using xampp for localhost and a basic database `interface Members { id: number; name: string; birthDate: string; gender: string; createdAt: string; } const…
kop csok
  • 1
  • 1
1 2 3
37
38