Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make difference between attribute and property clearer #848

Open
tricki opened this issue Mar 11, 2022 · 0 comments
Open

Make difference between attribute and property clearer #848

tricki opened this issue Mar 11, 2022 · 0 comments
Assignees

Comments

@tricki
Copy link
Contributor

tricki commented Mar 11, 2022

I keep seeing people using attributes in JSX and wondering why they can't pass objects to child components (for example in this issue and more recently in this StackOverflow question).

The docs are somewhat vague about the difference:

In the JavaScript ecosystem, it's common to use 'camelCase' when naming variables.

and:

When we use our component in a TSX file, an attribute uses camelCase

(which is incorrect since camelCase refers to the property instead)

Some information about how Stencil parses and transforms attributes in general (e.g. parsing strings to booleans and numbers) would also be great, but that might be outside the scope of this request.

Maybe add a link to https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes#content_versus_idl_attributes

@rwaskiewicz rwaskiewicz self-assigned this Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants