如何在 HypserStack 中使用 MaterialUI 的 Mobile-Stepper?

How to use MaterialUI's Mobile-Stepper in HypserStack?

我尝试在 Hyperstack 中使用移动步进器组件 (https://material-ui.com/demos/steppers/#mobile-stepper-progress),但出现此错误:

Failed prop type: Invalid prop `nextButton` supplied to `MobileStepper`, expected a ReactNode. in MobileStepper

它只呈现进度条而不呈现按钮。

尝试了各种方法,即:

Mui.MobileStepper( variant: "progress", steps: 6, position: "static",
                   nextButton: lambda { Mui.Button(size: "small") {'next'} },
                   backButton: lambda { Mui.Button(size: "small") {'back'} })

您想将完整的 ReactNode 传递给 nextButton 和 backButton 属性。您还需要将组件转换为原生 javascript。您可以在任何 Hyperstack 组件上调用 to_n 以将其转换为原生 React class.

Mui.MobileStepper( variant: "progress", steps: 6, position: "static",
                   nextButton: Mui.Button(size: "small") {'next'}.to_n,
                   backButton: Mui.Button(size: "small") {'back'}.to_n)