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-anything benefits #1

Closed
larrybotha opened this issue Apr 12, 2016 · 2 comments
Closed

react-anything benefits #1

larrybotha opened this issue Apr 12, 2016 · 2 comments

Comments

@larrybotha
Copy link

What are the benefits of using react-anything over react? Is it primarily reduced file-size, or does it contribute to Phaser dev?

EDIT: whoops - nevermind. I see on https://github.com/evilfer/react-phaser that you are providing an API :)

@evilfer
Copy link
Owner

evilfer commented Apr 12, 2016

Hi Larry,

The goal behind react-anything is to make it easier to build alternative native implementations of react. react-phaser is one example, in which 'native nodes' manipulate Phaser objects instead of DOM elements or mobile native views).

What it does:

  • removes the default DOM manipulation implementation from React (which affects what happens during a transaction, and how native or empty nodes are treated).
  • provides a render function that initializes the VDOM.
  • allows injecting a native implementation by defining a set of hooks. Specifically, a native implementation simply needs to implement:
{
    components: {
        mount: function (id, tag, props, parent) {},
        unmount: function (node) {},        
        update: function (node, nextProps, lastProps) {}
    },
    transaction: {
        initialize: function () {},
        close: function (node) {}
    }
}

@larrybotha
Copy link
Author

awesome, thanks @evilfer

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

No branches or pull requests

2 participants