biotope / biotope/biotope-element

Props passed via attribute on to child components disappear after render

Open
#306 0 comments 0 reactions 0 assignees View on GitHub
bug
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.