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
2
votes
1 answer

React Typescript: How to handle Formik File Upload?

I am using Formik on React Typescript to handle my Student Profile form. This form is supposed to handle resume and transcript file upload. I noticed that everything worked great until I tested my form in Chrome and saw in the console log that the…
infinite_l88p
  • 31
  • 1
  • 5
2
votes
1 answer

How can I order messages in the create-daml-app project in reverse chronological order?

I have been working on adding a few small UI features to the create-daml-app project (https://github.com/digital-asset/daml/tree/ba27ea9af4f39a9a3f307384e05f4bf540101f03/templates/create-daml-app). Specifically, I have added the direct messaging…
Quantifier
  • 135
  • 1
  • 8
2
votes
1 answer

How to use portals in Next.js in getting the child element outside the immediate parent container?

Current Implementation Container export const FormContainer = () => { return (
); } Component export const Form = () => { return ReactDOM.createPortal( , …
Harsh Nagalla
  • 1,198
  • 5
  • 14
  • 26
2
votes
1 answer

Object is possibly null error (typescript) when trying to display the value of an array which is stored in localstorage

I'm currently creating a weather app where you can store your favorite locations which are pushed to an array, which in turn is stored in localstorage. Now, I want to display the values of the array in a different component, but with my code I keep…
2
votes
0 answers

Handle self written types definition in TypeScript project

In my React project using TypeScript I wrote some types definition that I need to reuse in many other files like for example the type: type TIconName = 'menu' | 'shop' | 'user' To make this type available in all my project I use a types.ts file…
johannchopin
  • 13,720
  • 10
  • 55
  • 101
2
votes
1 answer

How to handle NaN in controlled input element with value of type number

In the situation like the code snippet below how should I handle NaN where the state type is number. The server sends an array of objects: interface MyInterface {id:number, amount:number, score:number} // The received data is of type…
Amir-Mousavi
  • 4,273
  • 12
  • 70
  • 123
2
votes
1 answer

React rendering new view with filtered Data in Model Driven PowerApps

Currently I am implementing a custom list in a model driven app. I noticed that while filtering the data the init method as well as the updateView method is called, furthermore the updateView method is called 3 times. However, the new view is not…
2
votes
1 answer

Can you increase the size of Pivots?

I am trying to implement a UI which has tabs (or Pivots ) from Office fabirc UI and i was wondering if i could increase the size(or better yet customize my pivot size)? I tried playing around with PivotLinkSize.large but i would like to increase…
novice_coder
  • 147
  • 2
  • 10
2
votes
0 answers

What type to specify when mapping the array of properties of the router?

I created an array of properties for a routes const routes: RouteProps[] = [ { path: '/', exact: true, component: Main, }, ]; and created a separate routing switch component const Routes: FunctionComponent = (): JSX.Element => { …
2
votes
1 answer

Call Typescript Apollo Query from componentDidMount()

I have a React Component that calls a Query that expects to receive an array of objects (for validation data). I then use it to validate an html form, that is in turn defined inside of an apollo Mutation element. The way it is structured within the…
2
votes
5 answers

How to pass li value to method in onclick event ? using react typescript

  • 2
  • 3
  • 4
  • 5
In onClick event, I have given a…
2
votes
1 answer

Why are these children as array not rendered in TS?

I have a dead simple component. Works perfectly in javascript. const Test = (props: any) =>
{props.children}
; const Root: React.SFC<{}> = props => { return (

hello world.

J. Reku
  • 509
  • 1
  • 5
  • 15
2
votes
1 answer

TS2604: JSX elemy type '' does not have any construct or call signatures

I worked on my lazy load component's loader and got an error TS2604: JSX elemy type 'LoadedAsyncComponent' does not have any construct or call signatures I think so I wrote a bad code and all, because I recently started writing on React +…
Sergey Volkov
  • 871
  • 11
  • 17
1
vote
0 answers

How to use svg sprite in react?

Hello I search many questions in stackoverflow about this issue but nothing help me. I have svg srite
1
vote
1 answer

I import uuid in my react typescript, Got an id error Type 'string' is not assignable to type 'number

**I got red line or error in id , i import uuid in my react typescript file,here is my code ** import { v4 as uuidv4 } from 'uuid'; const handleAddUser = () => { setValues({ name: '', email: '' }); dispatch(addUser({ id : uuidv4(), …