Closed rascala closed 7 years ago
Thanks for the report. The ts2fable needs an overwrite but I'll have a look at the issue. There's an example of using material-ui components dynamically (without bindings) here, but I'm not sure if it applies to your use case.
Thanks for the link. I had looked at it but didn't want to go the dynamic way. For now, I plan to manually write the signatures for the components I want. Hopefully, I can bring it to parity with the .ts file as time goes and port some of the sample projects to material-ui.
I haven't used fable-elmish that much myself, but to instantiate a React imported component I think you can use Fable.Helpers.React.from
.
Description
ts2fable fails with ERROR: TypeError: Cannot read property 'forEach' of undefined when run on material-ui.d.ts
Repro steps
Please provide the steps required to reproduce the problem
Expected behavior
Generate a fable to js interface file
Actual behavior
Fails with ERROR: TypeError: Cannot read property 'forEach' of undefined
-- At line 739 of ts2fable. Looks like node.body.statements is undefined.
Known workarounds
Comment out the "declare namespace __MaterialUI.Styles " block starting on line 7319 in the .d.ts file. Works then.
This .d.ts file seems to have some archaic syntax not commonly seen in typescript files.
Still unable to figure out how to use the generated components from the .fs file in fable-elmish example. Any tips would be appreciated!!
Related information