我想知道将字符串值与 JSX 标签内的变量混合的最佳实践是什么,我列出了我熟悉的选项:
render() {
    const {totalCount} = this.state;
    const totalCountStr = `Total count: ${totalCount}`;
    return (
        <div>
            <h1>Total count: {totalCount}</h1> // 1
            <h1>`Total count: ${totalCount}`</h1> // 2
            <h1>{totalCountStr}</h1> // 3
        </div>
    );
}
以不同方式使用它们的最佳实践或用例是什么?
谢谢!