You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched for existing issues that already report this problem, without success.
Stencil Version
latest
Current Behavior
When defining component properties in Stencil, there is currently a discrepancy between how Stencil reads property names during runtime and hydration.
Given the following component:
// my-component.tsximport{Component,Prop,h}from'@stencil/core';import{format}from'../../utils/utils';
@Component({tag: 'my-component',styleUrl: 'my-component.css',shadow: true,})exportclassMyComponent{/** * The first name */
@Prop()firstName: string;/** * The middle name */
@Prop()middleName: string;/** * The last name */
@Prop()lastName: string;privategetText(): string{returnformat(this.firstName,this.middleName,this.lastName);}render(){return<div>Hello,World!I'm {this.getText()}</div>;
}}
and
// stencil-component.tsximport{Component,h}from'@stencil/core';
@Component({tag: 'stencil-component',shadow: true,})exportclassStencilComponent{render(){return<div><code><my-componentfirstName="Stencil"middleName="'Don'tcallmeaframework'"lastName="JS"></MyComponent></code><my-componentfirstName="Stencil"middleName="'Don't call me a framework'"lastName="JS"></my-component><hr/><code><my-componentfirst-name="Stencil"middle-name="'Don'tcallmeaframework'"last-name="JS"></my-component></code><my-componentfirst-name="Stencil"middle-name="'Don't call me a framework'"last-name="JS"></my-component></div>}}
Now if you render the following HTML template:
<!DOCTYPE html><htmldir="ltr" lang="en"><head><metacharset="utf-8" /><metaname="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" /><title>Stencil Component Starter</title><scripttype="module" src="/build/propscal.esm.js"></script><scriptnomodulesrc="/build/propscal.js"></script></head><body><code>
<my-component firstName="Stencil" middleName="'Don't call me a framework'" lastName="JS"></my-component>
</code><my-componentfirstName="Stencil" middleName="'Don't call me a framework'" lastName="JS"></my-component><hr><code>
<my-component first-name="Stencil" middle-name="'Don't call me a framework'" last-name="JS"></my-component>
</code><my-componentfirst-name="Stencil" middle-name="'Don't call me a framework'" last-name="JS"></my-component><hr><hr><stencil-component/></body></html>
You receive the following output:
However, if you hydrate the template, you receive:
Note the differences: first-name and other properties are not recognised when rendered in a JSX context.
Expected Behavior
The behavior should be the same across runtime and hydrate mode.
Prerequisites
Stencil Version
latest
Current Behavior
When defining component properties in Stencil, there is currently a discrepancy between how Stencil reads property names during runtime and hydration.
Given the following component:
and
Now if you render the following HTML template:
You receive the following output:
However, if you hydrate the template, you receive:
Note the differences:
first-name
and other properties are not recognised when rendered in a JSX context.Expected Behavior
The behavior should be the same across runtime and hydrate mode.
System Info
Steps to Reproduce
https://github.com/christian-bromann/stencil-case-repro
Code Reproduction URL
n/a
Additional Information
n.a
The text was updated successfully, but these errors were encountered: