我正在学习Reasonml,对此感到非常兴奋。我经常在打字稿反应代码中做的事情是:
type Props = React.HTMLProps<HTMLButtonElement> & { foo: boolean }
const SuperButton: React.FC<Props> = (props) => <button {/* stuff with props */ />
在这方面,我作为组件库提供者向用户传达了此按钮扩展了常规HTML按钮属性的信息。
如何在组件中表达和扩展普通的html组件属性?
我看到该原因明显不支持传播道具:https://github.com/reasonml/reason-react/blob/master/docs/props-spread.md。
我确实看到了一种合成策略:How to compose props across component in reason-react bindings?,但不确定如何将其与普通的HTML元素组件结合起来。
有什么建议吗?谢谢!