jackyho112 / react-html-attributes Goto Github PK
View Code? Open in Web Editor NEWA store of react-supported html attributes keyed by their tags
License: MIT License
A store of react-supported html attributes keyed by their tags
License: MIT License
Hi,
thanks for the great package! It saved me a lot of trouble.
I was wondering if there's a reason why onClick
is only considered valid for a
tags?
I am writing a parser that builds a React component tree from an HTML string. I have slowly been adding to a map of html attribute names to their React counterparts. It would be nice not to have to do this manually, and I stumbled across this library which gives us all the React attribute names, but not what their "native" names are.
Would a utility function that maps an attribute name to its React equivalent be something that you would be interested in adding to this library?
e.g.
toReactAttribute('allowfullscreen')
//=> 'allowFullScreen'
Cheers
It seems that npm has a version 1.4.3 of this package, and it's unclear what that actually is.
Perhaps we could have a new release (>1.4.3) both here and on npm? I am interested in recent additions, e.g. onFocus, onKeyDown, etc, which are not yet available in the released package.
According to React documentation, form
elements should support the following events:
onChange
onInput
onInvalid
onSubmit
However, they don't seem to be accepted as props in the definition of form
I'm unsure what this is. Could you explain that a little?
@jackyho112 I think you should update the Code of Conduct with your contact information?
html-element-attributes
is currently listed as both a peer and regular dependency in package.json. Is this by design?
{
"dependencies": {
"html-element-attributes": "^1.0.0"
},
"peerDependencies": {
"html-element-attributes": "^1.0.0"
},
}
The presence of the peer dependency is currently causing issues with the installation of paypal/glamorous. On npm 2, it leads to an extraneous dependency error and similarly can lead to a missing peer dependency error.
Would it make sense to remove the peer dependency?
Thanks for the work you put into creating this project.
I was looking at the tests files and noticed one test checking if the array is alphabetically sorted. (see here).
Looking at the regex test we have, it looks like it's only checking that the first letter of the first element in the array is an alphabet character, or -
. It makes no assumptions about any of the elements actually being in alphabetical order.
For example,
[
['carrot', 'apple', 'banana'],
['apple', 'carrot', 'banana'],
['banana', 'apple', 'carrot'],
]
// would pass your test
Even if the regex test did work, does the ordering of the elements matter?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.