pmndrs / gltfjsx

🎮 Turns GLTFs into JSX components
https://gltf.pmnd.rs
MIT License
4.42k stars 290 forks source link

feat: add option for default export #196

Closed davcri closed 6 months ago

davcri commented 1 year ago

Not sure if it's worth polluting the options list for this, however I had to do it for one of my work projects and I thought to share it here. Hope it's helpful to someone.

hrh858 commented 1 year ago

I think this should be merged, it is actually really useful and even necessary if converting many files!

A funciton to set the name of the component would also be helpful I mean export function [Name]() {...} where we are able to tell the Name from the command.

davcri commented 1 year ago

A function to set the name of the component would also be helpful I mean export function [Name]() {...} where we are able to tell the Name from the command.

This would be really nice. It would be nice to default the export component name to the GLB root node name. Is it a bad idea?

@drcmda any thoughts on this? I could update the PR if needed