我想打印一个函数的类型.
func thanksTo(name: String) {
print("Thanks, \(name)")
}
printType(thanksTo) // expected to print "Function (String) -> ()"
Run Code Online (Sandbox Code Playgroud)
Swift中有任何功能printType吗?
我有两个组件,App和Root.应用程序有路由,并提供常见的布局.
const App = () => (
<Layout>
<Routes />
</Layout>
)
const Root = () => (
<Providers>
<App />
</Providers>
)
Run Code Online (Sandbox Code Playgroud)
同时Providers包含redux Provider,redux-persist PersistGate和react-router-redux ConnectedRouter.
所以,我的主要问题是
hot(module)(Component)助手放在哪里?在App?或者Root?这些都是关于AppContainerAPI的.
hot帮手和AppContainer?之间的区别是什么?有没有AppContainer比这更合适的特殊情况hot?我曾尝试在graphql中使用变量,但是似乎无法通过'application / graphql'发送变量。
我是否应该继续转到Content-Type:'application / json'?
我正在使用react@16.0.0-beta.5和flow-bin@0.54.0
我正在尝试在此组件上应用flowtype
// @flow
class SomeIcon extends Component<{}> {
render() {
return (
<i>
<img src="" />
<span>Hello</span>
</i>
)
}
}
Run Code Online (Sandbox Code Playgroud)
而流量说
14: <i>
^^^ React element `i`
14: <i>
^^^ React children array. This type is incompatible with
children?: React$Node,
^^^^^^^^^^ union: undefined | null | boolean | number | string | type application of type `React$Element` | type application of identifier `Iterable`
Run Code Online (Sandbox Code Playgroud)
当我删除<span>标签中的<i>标签时,流程就可以了.但是如果我使用多个孩子,则流出错误.
问题是什么?