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

React Native support #42

Closed
somecatdad opened this issue Dec 17, 2019 · 2 comments
Closed

React Native support #42

somecatdad opened this issue Dec 17, 2019 · 2 comments
Labels

Comments

@somecatdad
Copy link

What sort of level of effort are we talking about to enhance react-json-schema to support React Native usage? Would it even be possible to work in the native app component world as opposed to the DOM world?

@brooksbecton
Copy link

Someone could use React Native elements by adding RN elements to the setComponentMap call

const schema = {
  component: "CommentList",
  children: [
    {
      component: "Comment",
      author: "Pete Hunt",
      children: [{ component: "Text", text: "This is one comment" }]
    },
    {
      component: "Comment",
      author: "Jordan Walke",
      children: [{ component: "Text", text: "This is *another* comment" }]
    }
  ]
};

const view = new ReactJsonSchema();
view.setComponentMap({ CommentList, Comment, Text, View });

It makes me wonder if a user could just pass in the same DOM object from react-dom-factories that is
happening in resolveComponents so this tool could be agnostic of ReactDOM or React Native

https://github.com/TechniqueSoftware/react-json-schema/blob/master/lib/ReactJsonSchema.js#L38

@eiof
Copy link
Collaborator

eiof commented Feb 12, 2020

It's reasonable to remove react-dom-factories as a dependency and have users pass in components from DOM.

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

No branches or pull requests

3 participants