magento-research / peregrine

(Defunct) Moved to https://github.com/magento-research/pwa-studio
Open Software License 3.0
29 stars 1 forks source link

Make the `.mount` function simpler (no args) #42

Closed zetlen closed 6 years ago

zetlen commented 6 years ago

This issue is a:

[ ] Bug [x] Feature suggestion [ ] Other

Description:

A React application must mount to a DOM node. Peregrine abstracts this into "app.mount()", but it still requires a reference to a container. That reference should be optional.

Environment and steps to reproduce

OS: Any

Magento 2 version: Any

Other environment information: Any

Steps to reproduce:

  1. Write an app file using Peregrine to create an app.
  2. Call app.mount() with no arguments.
  3. Run in development mode and observe errors.

Expected result:

The application renders into the document anyway.

Possible solutions:

Peregrine should always create a DOM node with standard class and role attributes, then appends it to the "container". The container should be document.body by default, but accept an argument for a DOM node to use instead.

Additional information:

DrewML commented 6 years ago

Closing this, as Peregrine no longer calls React.DOM directly after #45