Skip to content

Abstract library to accept alternative JXM providers #671

@Swivelgames

Description

@Swivelgames

It's not a major change, but certainly a major paradigm pivot. It would be awesome to pivot this library from being strictly React specific, and allow the user to specify a JXM renderer themselves.

i.e., instead of using React.createElement, it would be cool if I could pass a function to JSONX that would be invoked whenever an element is created.

The implementation might look like simply abstracting all React.createElement calls to a jxmProvider(type, props, children), and probably making (...args) => React.createElement(...args) the default provider or something.

I put together something very similar to this utility for React, and this is a feature I was planning on adding, but I think it makes a lot of sense to go with something that already exists.

Metadata

Metadata

Assignees

No one assigned

    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