useConfig
The useConfig
hook allows you to retrieve the current framework configuration dynamically within a component.
Syntax
const config = useConfig();
console.log(config);
Example
NOTE: We are using this.config
instead of config
because avoidDeprecatedWith
is set to true
.
<p>{{ JSON.stringify(this.config) }}</p>
const { useConfig } = DOMY;
DOMY.createApp(() => {
const config = useConfig();
return {
config
};
})
.configure({ avoidDeprecatedWith: true })
.mount();