after upgrading to meteor 0.9.1 i keep getting “Warning: Blaze.insert has been deprecated.”

孤街醉人 提交于 2020-01-05 17:37:29

问题


Hi I just upgraded my meteor app to 0.9.1.1 and I keep getting these 2 warnings in my console

W20140910-18:37:07.781(3) (blaze.js:67) Warning: Blaze.render without a parent element is deprecated. You must specify where to insert the rendered content. logging.js:65
W20140910-18:37:07.787(3) (blaze.js:67) Warning: Blaze.insert has been deprecated.  Specify where to insert the rendered content in the call to Blaze.render. logging.js:65

I have no idea from where the error occurs, or why it happens.

Any idea of what I might be missing ?

Thanks


回答1:


The blaze API changed in meteor 0.9+ If you are using

 UI.insert(UI.render(Template.foo), document.body)
 UI.insert(UI.renderWithData(Template.foo, {bar: "baz"}), document.body)

You need to update UI.insert() & UI.insert(UI.renderWithData())

to the new Blaze API:

Blaze.render(templateOrView, parentNode, [nextNode], [parentView])
Blaze.renderWithData(templateOrView, data, parentNode, [nextNode], [parentView])

Check updates: http://docs-0.9.1.meteor.com/#blaze_render



来源:https://stackoverflow.com/questions/25769675/after-upgrading-to-meteor-0-9-1-i-keep-getting-warning-blaze-insert-has-been-d

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!