VulcanJS / vulcan-npm

The full-stack JavaScript App Framework
https://vulcan-docs.vercel.app
MIT License
30 stars 8 forks source link

component override #143

Open SachaG opened 1 year ago

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
vulcan-docs ✅ Ready (Inspect) Visit Preview Sep 30, 2022 at 0:37AM (UTC)
vulcan-npm ❌ Failed (Inspect) Sep 30, 2022 at 0:37AM (UTC)
eric-burel commented 1 year ago

Not needed imo, this is equivalent to what your are trying to achieve

// eg if Loading allows to override its Button locally
const Loading = ({components}: { components: Partial<Pick<VulcanCoreComponents, "Button">>) => {
  const VulcanComponents = useVulcanComponents()
  const Components = {...components, ...VulcanComponents }
  return (<Components.Button>Loading...</Components.Button>)
}