const handleChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {
setValue(e.target.value);
};
так делал:
<table>
<thead>
<tr className="description">
<th>#Logo</th>
<th>Name</th>
<th>Current Price</th>
<th>Coin Volume</th>
<th>Price Change</th>
<th>Market Capitalization</th>
</tr>
</thead>
<tbody>
{props.coins.map((coins) => {
return (
<tr>
<Link to={`/coin/${coins.id}`} key={coins.id}>
<CoinItem coins={coins} />
</Link>
</tr>
);
})}
</tbody>
</table>
react-dom.development.js:86 Warning: validateDOMNesting(...): cannot appear as a child of .
Буду переделывать на гридах
<table>
<thead>
<tr className="description">
<th>#Logo</th>
<th>Name</th>
<th>Current Price</th>
<th>Coin Volume</th>
<th>Price Change</th>
<th>Market Capitalization</th>
</tr>
</thead>
{props.coins.map((coins) => {
return (
<Link to={`/coin/${coins.id}`} key={coins.id}>
<CoinItem coins={coins} />
</Link>
);
})}
</table>
<tbody className="coin-wrapper">
<tr className="coin-data">
<td>
<h3>{props.coins.market_cap_rank}</h3>
<img src={props.coins.image} alt="crypto" />
</td>
<td>
<h1>{props.coins.name}</h1>
</td>
<td>
<p className="coin-price">${props.coins.current_price.toFixed(3)}</p>
</td>
<td>
<p className="coin-volume hide-mobile">
${props.coins.total_volume.toLocaleString()}
</p>
</td>
<td>
{props.coins.price_change_24h < 0 ? (
<p className="coin-percent red hide-price">
{props.coins.price_change_24h.toFixed(2)}%
</p>
) : (
<p className="coin-percent green hide-price">
{props?.coins.price_change_24h?.toFixed(4)}%
</p>
)}
</td>
<td>
<p className="coin-marketcap hide-mobile">
${props.coins.market_cap.toLocaleString()}
</p>
</td>
</tr>
</tbody>
<table>
<thead>
<tr>
<th>#Logo</th>
<th>Name</th>
<th>Current Price</th>
<th>Coin Volume</th>
<th>Price Change</th>
<th>Market Capitalization</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<h3>{props.coins.market_cap_rank}</h3>
<img src={props.coins.image} alt="crypto" />
</td>
<td>
<h1>{props.coins.name}</h1>
</td>
<td>
<p className="coin-price">
${props.coins.current_price.toFixed(3)}
</p>
</td>
<td>
<p className="coin-volume hide-mobile">
${props.coins.total_volume.toLocaleString()}
</p>
</td>
<td>
{props.coins.price_change_24h < 0 ? (
<p className="coin-percent red hide-price">
{props.coins.price_change_24h.toFixed(2)}%
</p>
) : (
<p className="coin-percent green hide-price">
{props?.coins.price_change_24h?.toFixed(4)}%
</p>
)}
</td>
<td>
<p className="coin-marketcap hide-mobile">
${props.coins.market_cap.toLocaleString()}
</p>
</td>
</tr>
</tbody>
</table>
<table>
<tr>
<th>#Logo</th>
<th>Name</th>
<th>Current Price</th>
<th>Coin Volume</th>
<th>Price Change</th>
<th>Market Capitalization</th>
</tr>
<tr>
<td>
<h3>{props.coins.market_cap_rank}</h3>
<img src={props.coins.image} alt="coin" />
</td>
<td>
<h1>{props.coins.name}</h1>
</td>
<td>
<p className="coin-price">${props.coins.current_price.}</p>
</td>
<td>
<p className="coin-volume hide-mobile">
${props.coins.total_volume}
</p>
</td>
<td>
{props.coins.price_change_24h < 0 ? (
<p className="coin-percent red hide-price">
{props.coins.price_change_24h}%
</p>
) : (
<p className="coin-percent green hide-price">
{props.coins.price_change_24h}%
</p>
)}
</td>
<td>
<p className="coin-marketcap hide-mobile">
${props.coins.market_cap.toLocaleString()}
</p>
</td>
</tr>
</table>
);
}