我想用3个输入调用一个函数。其中2个是数字,一个是字符串。这两个数字进一步传递了,但这不是问题。我希望将字符串打印在元素中。
我认为这是将参数传递给代码的html部分的问题,但是我不知道该怎么做。
import Typography from '@material-ui/core/Typography';
export function myfunction(name,min max){
const midpoint = Math.ceil((min + max)/2)
return(
<div>
<Typography id="input-slider">
name //this is where I want name to be
</Typography>
<div/>
)
}
在第二个文件中,我称之为
function main(){
return(
<div>
{myfunction(MYNAME,10)
<div/>
)
}