How I can build dynamic button in reactjs

I'm new to react and I would like to build a dynamic button, I wrote this code but I don't know How I can pass text, style, and size to this button.

import "./button.css";
import React from "react";

const Button = ({
  type,
  onClick,
  buttonStyle,
  buttonSize,
}) => {
  return (
    <div>
      <div>
        <button
          type={type}
          onClick={onClick}
          buttonStyle={buttonStyle}
          buttonSize={buttonSize}
        ></button>
      </div>
    </div>
  );
};

export default Button;



Read more here: https://stackoverflow.com/questions/68473255/how-i-can-build-dynamic-button-in-reactjs

Content Attribution

This content was originally published by Aida at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: