feat(ui): resolve route-relative hrefs by default in useDefinition
Made href resolution always-on in useDefinition instead of requiring each component to opt in via resolveHref: true. The hook now always calls useInRouterContext/useHref and only applies the resolved value when an href prop is actually provided, preventing href from leaking into components that don't accept it. Removed the resolveHref field from ComponentConfig, the ResolveHrefConstraint type, and resolveHref: true from all 14 component definitions. Also removed a now-unnecessary type cast in the Text component. Signed-off-by: Johan Persson <johanopersson@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/ui': patch
|
||||
---
|
||||
|
||||
Resolved route-relative `href` props to absolute paths by default in all components, removing the need for the `resolveHref` option in component definitions.
|
||||
Reference in New Issue
Block a user