React.render replace container instead of inserting into

前端 未结 4 702
花落未央
花落未央 2020-12-09 16:05

I\'m gradually replacing some Backbone views with React.

My React View:

Rendered By React
4条回答
  •  北海茫月
    2020-12-09 16:46

    Unfortunately there is no way to do that currently with React. It replaces the contents of whatever element you render into.

    The best you can do for now is render the React component separately and then mutate the DOM manually to get it where you want it.

    I expect the functionality you seek will be available in React before long, but not yet!

提交回复
热议问题