为了账号安全,请及时绑定邮箱和手机立即绑定

请问浏览器返回 react执行哪个函数?

请问浏览器返回 react执行哪个函数?

子衿沉夜 2019-07-08 09:05:24
浏览器返回 react执行哪个函数
查看完整描述

2 回答

?
梵蒂冈之花

TA贡献1900条经验 获得超5个赞

<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>Document</title>
</head>

<body>
<script src="./react-0.13.2/build/react.js"></script>
<script src="./react-0.13.2/build/JSXTransformer.js"></script>
<script type="text/jsx">
var style = {
color : "red",
border: "1px #000 solid",
};
var HelloWorld = React.createClass({
getDefaultProps: function(){console.log("getDefaultProps1");},
getInitialState: function(){console.log("getInitialState2");return null;},
componentWillMount:function(){console.log("componentWillMount3")},
render: function(){
console.log("render4");
return <p>初始化阶段的函数执行状态</p>
},
componentDidMount:function(){console.log("componentDidMount5")}
});
React.render(<div style={style}><HelloWorld></HelloWorld></div>, document.body);
</script>
</body>


查看完整回答
反对 回复 2019-07-14
?
守着一只汪

TA贡献1872条经验 获得超3个赞

  回调,是非常基本的概念,尤其在现今NodeJS诞生与蓬勃发展中变得更加被人们重视。很多朋友学NodeJS,学很久一直摸不着门道,觉得最后在用Express写Web程序,有这样的感觉只能说明没有学懂NodeJS,本质上说不理解回调,就不理解NodeJS。
  NodeJS有三大核心:
- CallBack回调
- Event事件
- Stream流

查看完整回答
反对 回复 2019-07-14
  • 2 回答
  • 0 关注
  • 1477 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信