我收到此错误:this.props.postBooks不是函数。
我有一个动作-postBooks-我正尝试通过道具发送。
这是我的组件:
"use strict"
import React from 'react'
import {Well,Panel,FormControl,FormGroup,ControlLabel,Button} from 'react-bootstrap'
import {connect} from 'react-redux'
import {bindActionCreators} from 'redux'
import {postBooks} from '../../actions/booksActions'
import {findDOMNode} from 'react-dom'
export class BooksForm extends React.Component{
handleSubmit(){
const book = [{
title: findDOMNode(this.refs.title).value,
description: findDOMNode(this.refs.description).value,
price: findDOMNode(this.refs.price).value
}]
this.props.postBooks(book)
}
render(){
return(
<Well>
<Panel>
<FormGroup controlId='title'>
<ControlLabel> Title </ControlLabel>
<FormControl
type='text'
placeholder='Enter Title'
ref='title' />
</FormGroup>
<FormGroup controlId='description'>
<ControlLabel> Enter Description </ControlLabel>
<FormControl
type='text'
placeholder='Enter Description'
ref='description' />
</FormGroup>
<FormGroup controlId='price'>
<ControlLabel> …Run Code Online (Sandbox Code Playgroud) 注意:解决方案可以使用 netcat 或任何其他内置的 Linux 实用程序
我需要实现一个 initContainer 和 liveness 探测器,以确认我的 redis pod 已为我的一个 redis 依赖 pod 准备就绪。我已尝试使用此处提供的 netcat 解决方案作为答案( (printf "PING\r\n"; sleep 1) | nc 10.233.38.133 6379),但我收到-NOAUTH Authentication required.错误响应。有什么办法解决这个问题吗?我知道我可以在我的 Django 代码中安装 redis-cli 或创建一个管理命令,但我不想这样做。我也不想为我的 Redis 实例实现 Web 服务器并使用 curl 命令。