如何将javascript变量与字符串组合?我必须连接变量吗?
{ /* JSX + Bootstrap */ }
<div className={s.container} + "col-md-offset-4 col-md-4 well">
编辑:谢谢你的帮助。这是我得到的错误
<div className={'col-md-offset-4 col-md-4 well' + s.container}>
// Error: Unexpected string concatenation
感谢您提出建议......以下是我按照这些文档时遇到的错误http://eslint.org/docs/2.0.0/rules/prefer-template
Module build failed: SyntaxError: JSX value should be either an expression or a quoted JSX text (23:23)
21 | return (
22 | <div className={s.root}>
> 23 | <div className=`col-md-offset-4 col-md-4 well ${s.container}`>
答案 0 :(得分:2)
<div className={`col-md-offset-4 col-md-4 well ${s.container}`}>