I'm new with React and TypeScript. I want to add a new row in a table when someone clicks a button (FontAwesomeIcon). I actually don't even know where to start.
Here's my code
import React from "react";
import './SchemeFillData.scss';
import {faPlus} from "@fortawesome/free-solid-svg-icons/faPlus";
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
export function SchemeFillData() {
return <div className='schemedata'>
<table className='schemedata__attr'>
<thead>
<th className='schemedata__attr__title' colSpan={2}>
Atrybuty
<FontAwesomeIcon className='schemedata__add' icon={faPlus} size='lg' color='lightgray'/>
</th>
</thead>
<tbody>
<tr>
<td className='scheme__attr__cell'>
<input className='schemedata__input attr__input' placeholder='Nazwa atrybutu' type='text'
id='unit'/>
</td>
<td className='scheme__attr__cell'>
<select id="defVat" className='schemedata__select attr__select'>
<option value="" disabled selected>Wybierz kolumnę</option>
</select>
</td>
</tr>
</tbody>
</table>
</div>;
}
What do I need to do? Where to start? Thanks for the answers :)