WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Make difference between attribute and property clearer #848

@tricki

Description

@tricki

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions