Home > database >  react.js what is mean <button></button>{" "}?
react.js what is mean <button></button>{" "}?

Time:10-03

I have following component.

If user clicked button with emoji, list of buttons should be hidden.

I have following component.

import { useState } from "react";

interface Props {
  emoji: string,
  name: string
}

export function EmojiRating({ emoji, name }: Props) {
  const [rating, setRating] = useState("");

  return (
    <div>
      <span>{emoji} - {name} </span>
      {rating ? (
        <span>{rating}</span>
      ) : (
        <>
          <button onClick={() => setRating("           
  • Related