Answer the question
In order to leave comments, you need to log in
How to write an exported element (not a class) React on tsx?
Let's say we have the following jsx code:
import React from 'react';
import './SomeObjectStyle.css';
export default props => (
<div className='SomeObjectSt'>
<h1> Object ID: {props.id} </h1>
<h2> Object Name : {props.name} </h2>
<h2> Object Parameter : {props.parameter}</h2>
<input style={{background: '#252525', color: '#6df'}} onChange={props.onUpdateBuffer} type="text"></input>
<button style={{background: '#252525', color: '#6df'}} onClick={props.onChangeName}> Change name </button>
</div>
)
Answer the question
In order to leave comments, you need to log in
export default - obsolete, inconvenient crap. Forget it.
export const SomeObject = (props) => ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question