react-ui-org / react-ui

React UI is a themeable and performant UI library for React apps.
https://react-ui.io
MIT License
21 stars 7 forks source link

GlobalProps inheritance #541

Closed mbohal closed 3 months ago

mbohal commented 6 months ago

Presently the GlobalProps mechanism does not allow overloading of only specific props. The entire object gets overloaded and thus it is near to impossible to use it to modify GlobalProps only for certain parts of the app.

Minimal Example:

<RUIProvider
  globalProps={{
    TextField: { layout: 'horizontal' },
  }}
>
  <RUIProvider
    globalProps={{
      TextField: { size: 'small' },
    }}
  >
    <TextField label="username" />
  </RUIProvider>
</RUIProvider>

Expected GlobalProps: layout=horizontal, size=small Received GlobalProps: size=small