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
vote
1 answer

react typescript error 'Type '{ ... }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<...>

I am just starting out with a react typescript project and I getting this cryptic error: Failed to compile. /Users/simon/Code/web/react-news-col/src/MainNewsFeed.tsx TypeScript error in…
SomethingsGottaGive
  • 1,646
  • 6
  • 26
  • 49
1
vote
2 answers

useContext value not updating

I was trying to use useContext to change the authentication state when a user logs in and this would be received in other components to conditionally show based on whether the user has logged in. Login Context was setup as below I passed the…
1
vote
1 answer

React: How to populate the Input field with one of the traversed searched value?

I'm trying to populate the input field with the presented searched value when there is being clicked on one of the search results. I'm fairly new to React FC and Typescript. I'm not sure how exactly is being done. This is what I have tried with the…
Waiz
  • 503
  • 2
  • 6
  • 15
1
vote
0 answers

adding jitsi-Meet video conferencing in react web app using external_api.js

i have added jitsi meet video conferencing in my react web app as described by this link. I have also added react-jitsi component as given in this link the loading meeting... does not go away and is stuck all the time and does not render jitsi…
Fiaz Ahmed Ranjha
  • 245
  • 1
  • 6
  • 22
1
vote
1 answer

Start UiPath Job with Input (string Array) using API

How can we pass Array as an input argument when we start a job using API? Background: I'm working on a react project and with a button click, I want to start a job with inputs. I know that we can pass an argument as "InputArguments": "{\"message\"…
Maryam
  • 357
  • 1
  • 5
  • 16
1
vote
1 answer

React image can't be loaded

I'm trying to to currently add an svg to my React-App. I've got a nginX running that currently only servs one picture (localhost:80/ban.svg is reachable by browser and returns the correct icon). import React from "react"; export class App extends…
Jan
  • 65
  • 5
1
vote
2 answers

React.tsx Material UI Tab error - Don't use '{}' as a type

I'm working on a React TS project and I'm trying to import the Material UI tabs https://material-ui.com/components/tabs/ The scrollable tabs specifcally. I am taking the TS example for Tabs/Scrollable Tabs, however when I include it in my project as…
MD9
  • 105
  • 2
  • 14
1
vote
1 answer

Login to Discord.js from React App w/ Typescript

import React from 'react'; import User from './components/User'; import Discord, { Message } from 'discord.js' import background from './images/background.png'; import './App.css'; const App = () => { const Discord = require('discord.js'); …
Matthew Trip
  • 326
  • 2
  • 15
1
vote
3 answers

Data from API call are stored in a Array but when i try to use that array in a function for further use it shows that array is empty . why?

React code for storing Data from API to an Array and Using the same Array's event_date value for further use. export const UpcomingHolidays = (props: UpcomingHolidaysProps) => { const [holidayPlans, setHolidayPlans] = useState([]); const…
1
vote
2 answers

Converting from React.js to React.tsx Property 'id' does not exist on type 'never'. TS2339

I am trying to follow a tutorial to learn react in type script. However when I build my solution I get and error. Code import React, { useState, useEffect } from 'react'; import axios from 'axios'; const DataFetching = () => { const [posts,…
Krishneil
  • 1,432
  • 1
  • 18
  • 26
1
vote
1 answer

Property 'customProperty' does not exist on type 'X[]'. Typescript React. TS2339

I'm trying to move a directory component into redux, but I keep getting this error. The type is basically an array of objects. If I change the type from 'Section' to any, then the sections prop in mapStateToProps complains that 'no overload matches…
Yusuf Abukar
  • 199
  • 1
  • 1
  • 9
1
vote
1 answer

Property 'target' does not exist on type 'HTMLInputElement'. TypeScript React. TS2339

The handleChange() function is called whenever the input element is changed, but can't seem to access event.target.value. Error Message Property 'target' does not exist on type 'HTMLInputElement'. TS2339 handleChange() handleChange =…
Yusuf Abukar
  • 199
  • 1
  • 1
  • 9
1
vote
3 answers

Property 'forEach' does not exist on type XXX in Typescript

I want to generate a list of table rows by using forEach() in Typescript and React. I get Property 'forEach' does not exist on type when using the code below. Does anyone know how to fix this? Shouldn't I be able to use forEach() on persons as it is…
jessica96
  • 45
  • 1
  • 4
1
vote
0 answers

override a default function property on react child element using cloneElement

So basically I am trying to make a table with arbitrarily typed inputs (i.e. select, number, text) that allow the user to add/edit/remove rows of the tables with said inputs: When you click the green check a table row is supposed to be added with…
bturner1273
  • 660
  • 7
  • 18
1
vote
0 answers

TS2345 error - Argument of type X is not assignable to parameter of type X[]

export default class Foo { first: string; second: X[]; } export function parse(foo?) { if(foo) { return Builder(Foo) .first(foo.first || "") .second(XFunctions.parse(foo.second.map(second => XFunctions.parse(second)))) …
kastaplastislife
  • 293
  • 2
  • 16