-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
Is it possible to mount an individual component? If not, would it be a reasonable feature request?
My current approach is to unmount all components on the page and then mount them again - but, this resets the state of all components on the page - and I even get inconsistent results when I expect all components to reset.
Consider adding an instance of an Item
component to a page through an ajax request:
document.getElementById('items')
.insertAdjacentHTML('beforeend', '<%= j render partial: 'items/item', locals: { item: @item } %>');
WebpackerReact.unmountComponents()
WebpackerReact.mountComponents()
Here's a change to the webpacker-react-example
that shows the full request/response in action.
renchap/webpacker-react-example@master...sealocal:add-item-with-remote-request
Please share thoughts on mounting a single component on the page.
Metadata
Metadata
Assignees
Labels
No labels