【发布时间】:2020-05-03 17:56:57
【问题描述】:
我正在使用 React Typescript。
- 如何将图像添加到我的按钮?
我试过这样做,没有错误,但我得到一个空白按钮。 - 如何在此处使用 Emotion CSS 设置按钮元素的样式?
import React from "react";
function PostButton(props){
let style = {
width:24,
height:24,
src: "../images/abc.png"
};
return(
<button style={style} onClick={() => props.handleClick()}>{props.label}</button>
);
}
return (
<div style={style}>
<PostButton src={"../images/abc.png"} handleClick = {props.incrementScore}/>
</div>
);
}
【问题讨论】:
标签: css reactjs typescript emotion