biotope / biotope/biotope-element
Props passed via attribute on to child components disappear after render
- Dominant language
- TypeScript
- Stars
- 15
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
I try to add a component B into component A inside its template and pass a prop from component A to component B. The prop then is available inside component B's script, but after component B is rendered, the attribute is not set on the component tag anymore. Thus, any attribute-based styling won't work.
**To Reproduce**
Steps to reproduce the behavior:
1. See description
**Expected behavior**
Props passed on as attributes from one component to another stay on the child's HTML tag.
**Additional context**
Can be temporarily fixed by re-setting the attribute inside of the rendered hook of the child.
Contributor guide
Research direction
Start with the described reproduction: add component B inside component A's template and pass a prop as an attribute. Inspect the child render path and rendered DOM, including the child’s rendered hook; done means the passed attribute remains on the child’s HTML tag after rendering and supports attribute-based styling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100