1.0.8 • Published 2 years ago

@unholster/react-use-config v1.0.8

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

react-use-config

Hook that provides runtime configuration via a hosted config.json file

Example

import { useConfig, ConfigProvider } from '@unholster/react-use-config'

const CONFIG_PATH = ...

// to set default config add new or derive from existing config. Is optional.
const configAdapter = (config: ConfigType): AdaptedConfigType => {
  return {
    ...config,
    // add any additional properties here
  }
}

<ConfigProvider configPath={CONFIG_PATH} configAdapter={configAdapter} >
  <App />
</ConfigProvider>


function App() {
  const config = useConfig<AdaptedConfigType>()
  ...
}
1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.1

2 years ago