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

Convert XML nodes to custom elements by default #10

Open
pgoldrbx opened this issue Dec 9, 2017 · 2 comments
Open

Convert XML nodes to custom elements by default #10

pgoldrbx opened this issue Dec 9, 2017 · 2 comments

Comments

@pgoldrbx
Copy link
Contributor

pgoldrbx commented Dec 9, 2017

Currently, we require converters to be defined to do anything. But as of React 16.x (if not earlier?), we can render custom/arbitrary tag names. This means that we can turn an XML document into a React tree without any provided converters.

e.g.

import { createElement } from 'react';
import { renderToStaticMarkup } from 'react-dom/server';

renderToStaticMarkup(createElement('foo'));
// => <foo></foo>

I'd like to propose that this be our default behavior.

@taveras
Copy link
Contributor

taveras commented Dec 11, 2017

i like this. it feels as if it will solve some edge cases

separately, i'd love an option in the constructor to throw an error / report a warning when an XML node is found without a converter

@pgoldrbx
Copy link
Contributor Author

You mean a constructor option to control whether or not we alert the library user of this issue? that makes sense. Naming the interface will be hardest. We'll have to do a bit of research I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants