小编Sna*_*ail的帖子

这个React组件中的{... props}是什么意思?

刚开始使用react-router.

当我在github(底部)遇到这段代码时,我正在使用react-router @ next(版本4 ).我有弱的React + ES6-fu因此需要你的帮助.

  1. 这里的{... props}是指向组件发送道具吗?
  2. {... props}在这里如何影响custom ="prop"?

ž

<Match pattern="/foo" 
       render={(props) => ( 
         <YourRouteComponent {...props} custom="prop"/> 
       )} 
/>
Run Code Online (Sandbox Code Playgroud)

reactjs react-router

3
推荐指数
1
解决办法
187
查看次数

在Python if语句中使用break

我有一个初学者的错误,我不知道我哪里出错了.

如果命令行参数[0]为空,我试图打破程序.

我在macports上运行python.

import sys

script = sys.argv[0]
ip = sys.argv[1]
port = sys.argv[2]

if script is None:
    print 'script argv is: ' + script
    break

print "[+] The script name is: " + script
print "[+] The IP is: " +IP+" and the port is: " +port
Run Code Online (Sandbox Code Playgroud)

我一直收到这个错误.

mars13:python beebs$ python sys.py
  File "sys.py", line 9
    break
SyntaxError: 'break' outside loop
Run Code Online (Sandbox Code Playgroud)

第9行是指休息.

python if-statement break

0
推荐指数
1
解决办法
130
查看次数

标签 统计

break ×1

if-statement ×1

python ×1

react-router ×1

reactjs ×1