Home > OS >  What does <button></button>{" "} mean in react.js?
What does <button></button>{" "} mean in react.js?

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