Skip to content

Add feature for SVG attributes conversion #136

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

Merged
merged 4 commits into from
Aug 13, 2017

Conversation

wadackel
Copy link
Contributor

Hi, Thank you for useful library 😃

I wanted to convert the attributes of SVG like #135.
However, when I actually convert it I got the following output.

- Actual: fill-rule, stroke-width
+ Expected: fillRule, strokeWidth

So we added SVGDOMPropertyConfig as an attribute mapping target as well as HTMLDOMPropertyConfig.

Related issues

@ritz078
Copy link

ritz078 commented Aug 9, 2017

Any chance of this getting merged soon ?

@wadackel
Copy link
Contributor Author

Hi @ritz078 .

If you are in a hurry, htmltojsx that corresponds to SVG is released in Scoped Package, so please try using it 😃

https://github.com/tsuyoshiwada/htmltojsx

@Daniel15
Copy link
Member

Sorry, I completely missed this... I'll take a look soon!

@wadackel
Copy link
Contributor Author

Hi @Daniel15, Thanks !

@ritz078
Copy link

ritz078 commented Aug 10, 2017

Thanks @tsuyoshiwada . FYI I am using it on https://transform.now.sh/html-to-jsx

}
output.push(this.toJSXKey(key) + ': ' + this.toJSXValue(this.styles[key]));
}
eachObj(this.styles, function(key, value) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have refactored the iteration of the object using the newly created eachObj helper.
I'm sorry I made a confusing change... 😢

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's totally fine, don't worry @tsuyoshiwada 😄 I was just wondering about why we couldn't just continue to use a regular for loop here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! It was worried whether it became a meddle, but I am relieved 😃

@Daniel15 Daniel15 merged commit fab1517 into reactjs:master Aug 13, 2017
@Daniel15
Copy link
Member

Daniel15 commented Sep 5, 2017

Released as 0.3.0 😃

@wadackel
Copy link
Contributor Author

wadackel commented Sep 5, 2017

Hi @Daniel15, Thank you 😄 I checked that I was working.

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

Successfully merging this pull request may close these issues.

3 participants