reactjs - SwitchTransition 不适用于常规 html 按钮
问题描述
https://codesandbox.io/s/switchtransition-component-iqm0d?from-embed
在上面的示例中,当我使用来自import { Button, Form } from "react-bootstrap";
.
但如果只是将大写 B 更改为 b:
<button onClick={() => setState((state) => !state)}>
{state ? "Hello, world!" : "Goodbye, world!"}
</button>
过渡效果不再起作用。
解决方案
推荐阅读
- rust - 在 for 迭代器中调用可变方法的不同方法
- java - TextView 不会显示 Html
- swift - 如何在 swift 中创建具有非常量变量的方法
- python - 防止 MySQL 在从 Python 导入数据时将浮点数/小数转换为 int
- typescript - 用于解析器 GraphQL 瑜伽的 TypeScript 类型(在上下文中使用 prisma2)
- mysql - 当我尝试访问或创建表时出现错误
- javascript - JavaScript 中被视为对象的函数
- java - 如何加快运行时 Java 代码检测?
- sql - 从字符串转换日期和/或时间时,面临转换失败等存储过程相关问题
- c++ - 如何以 typedef 方式重新定义 MPI_FLOAT、MPI_DOUBLE