如何在导出默认值中传递值

时间:2015-08-19 10:12:52

标签: javascript node.js ecmascript-6 react-jsx

我有一个像

这样的功能
    export default (
  <Route name="App" path="/" handler={App}>
    <NotFoundRoute handler={require('./pages/PageNotFound')} />
    <Route handler={TaskList} data={data} >
    </Route>
    {data.map(task =>
              <Route name={task.PageName}  handler={require(task.PageUrl)}>
             </Route>
          )}

  </Route>
);

我想将数据传递给此代码,以便我可以将此代码转换为函数,任何人都可以帮助传递它

1 个答案:

答案 0 :(得分:3)

您正在导出[2015-08-19T11:05:36.104+0200] [glassfish 4.1] [WARNING] [NCLS-JMX-00007] [javax.enterprise.system.jmx] [tid: _ThreadID=83 _ThreadName=Thread-30] [timeMillis: 1439975136104] [levelValue: 900] [[ Cannot start JMX connector JmxConnector config: { name = system, Protocol = rmi_jrmp, Address = XXX, Port = 8686, AcceptAll = false, AuthRealmName = admin-realm, SecurityEnabled = true} due to exception java.lang.NullPointerException]] [2015-08-19T11:05:36.104+0200] [glassfish 4.1] [SEVERE] [] [] [tid: _ThreadID=83 _ThreadName=Thread-9] [timeMillis: 1439975136104] [levelValue: 1000] [[ java.lang.NullPointerException at org.glassfish.admin.mbeanserver.ssl.SecureRMIServerSocketFactory.<init>(SecureRMIServerSocketFactory.java:97) at org.glassfish.admin.mbeanserver.RMIConnectorStarter.<init>(RMIConnectorStarter.java:148) at org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread.startConnector(JMXStartupService.java:310) at org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread.run(JMXStartupService.java:350)]] 。只需使它成为一个函数,以便为它提供允许传递参数的参数:

React.Component