我正在学习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 元素组件结合起来。
有什么建议吗?谢谢!