<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>http://test.largeq.cn/index.php?action=history&amp;feed=atom&amp;title=React%E8%B0%83%E7%94%A8%E5%85%B6%E5%AE%83%E7%BB%84%E4%BB%B6%E7%9A%84%E6%96%B9%E6%B3%95</id>
	<title>React调用其它组件的方法 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="http://test.largeq.cn/index.php?action=history&amp;feed=atom&amp;title=React%E8%B0%83%E7%94%A8%E5%85%B6%E5%AE%83%E7%BB%84%E4%BB%B6%E7%9A%84%E6%96%B9%E6%B3%95"/>
	<link rel="alternate" type="text/html" href="http://test.largeq.cn/index.php?title=React%E8%B0%83%E7%94%A8%E5%85%B6%E5%AE%83%E7%BB%84%E4%BB%B6%E7%9A%84%E6%96%B9%E6%B3%95&amp;action=history"/>
	<updated>2026-04-20T01:44:59Z</updated>
	<subtitle>本wiki的该页面的版本历史</subtitle>
	<generator>MediaWiki 11.45.14</generator>
	<entry>
		<id>http://test.largeq.cn/index.php?title=React%E8%B0%83%E7%94%A8%E5%85%B6%E5%AE%83%E7%BB%84%E4%BB%B6%E7%9A%84%E6%96%B9%E6%B3%95&amp;diff=460&amp;oldid=prev</id>
		<title>2020年7月11日 (六) 03:11 IVEN</title>
		<link rel="alternate" type="text/html" href="http://test.largeq.cn/index.php?title=React%E8%B0%83%E7%94%A8%E5%85%B6%E5%AE%83%E7%BB%84%E4%BB%B6%E7%9A%84%E6%96%B9%E6%B3%95&amp;diff=460&amp;oldid=prev"/>
		<updated>2020-07-11T03:11:05Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2020年7月11日 (六) 03:11的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l15&quot; &gt;第15行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第15行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;好吧，这个插件不支持ES6语法。。。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;好吧，我的mediawiki的这个语法高亮插件似乎不支持ES6语法。。。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>IVEN</name></author>
		
	</entry>
	<entry>
		<id>http://test.largeq.cn/index.php?title=React%E8%B0%83%E7%94%A8%E5%85%B6%E5%AE%83%E7%BB%84%E4%BB%B6%E7%9A%84%E6%96%B9%E6%B3%95&amp;diff=459&amp;oldid=prev</id>
		<title>IVEN：创建页面，内容为“一个react组件实际上是一个类。所以只要把它new出来就可以了！  &lt;source lang=&quot;javascript&quot;&gt; let bComponent=new BComponent(this.props); bComponent…”</title>
		<link rel="alternate" type="text/html" href="http://test.largeq.cn/index.php?title=React%E8%B0%83%E7%94%A8%E5%85%B6%E5%AE%83%E7%BB%84%E4%BB%B6%E7%9A%84%E6%96%B9%E6%B3%95&amp;diff=459&amp;oldid=prev"/>
		<updated>2020-07-11T03:10:20Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“一个react组件实际上是一个类。所以只要把它new出来就可以了！  &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt; let bComponent=new BComponent(this.props); bComponent…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;一个react组件实际上是一个类。所以只要把它new出来就可以了！&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
let bComponent=new BComponent(this.props);&lt;br /&gt;
bComponent.testMethod();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
但是要注意，我在实际使用时，发现A组件调用B组件的方法时，B组件的this是指向A组件的。所以B组件中的方法如果操作了一些props,states，要确保A组件也有相同的props和states。&lt;br /&gt;
&lt;br /&gt;
还有，如果被调用的组件是个高阶组件，比如它被redux的connect方法包装过，要使用WrappedComponent。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
let bComponent=new BComponent.WrappedComponent(this.props);&lt;br /&gt;
bComponent.testMethod();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
好吧，这个插件不支持ES6语法。。。&lt;/div&gt;</summary>
		<author><name>IVEN</name></author>
		
	</entry>
</feed>