Quisiera saber por qué no puedo puedo enviar una propiedad desde un "container"(funcional) a un "component"(Presentacional). Miren el código.
import React, { PureComponent } from "react";
/*Importing Register Form*/
import NotLoggedRegisterForm from "./NotLoggedRegisterForm";
export default class HandleForm {
handleSubmit = e => {
e.preventDefault();
alert(2);
};
render() {
return <NotLoggedRegisterForm propiedad="algo" />;
}
}
Ese es el "container" es quien debería enviarme propiedad a NotLoggedRegisterForm en vez de eso, recibo undefined. Aquí el código de mi componente funcional
import React from "react";
/*Importing Antd*/
import { Form, Input, Icon, Button } from "antd";
export default Form.create()(function NotLoggedRegisterForm(props) {
const { getFieldDecorator } = props.form;
const FormItem = Form.Item;
return (
<Form id="hero-register-form">
<h1>Proeidad: {props.propiedad}</h1>
<FormItem>
{getFieldDecorator("email", {
rules: [{ required: true, message: "Please input your email!" }]
})(
<Input
prefix={<Icon type="mail" style={{ color: "rgba(0,0,0,.25)" }} />}
type="email"
placeholder="Email"
/>
)}
</FormItem>
<FormItem>
{getFieldDecorator("password", {
rules: [{ required: true, message: "Please input your Password!" }]
})(
<Input
prefix={<Icon type="lock" style={{ color: "rgba(0,0,0,.25)" }} />}
type="password"
placeholder="Password"
/>
)}
</FormItem>
<FormItem>
{getFieldDecorator("password", {
rules: [
{
required: true,
message: "Please input your Confirm password!"
}
]
})(
<Input
prefix={<Icon type="lock" style={{ color: "rgba(0,0,0,.25)" }} />}
type="password"
placeholder="Confirm password"
/>
)}
</FormItem>
<FormItem>
<Button
type="primary"
style={{ backgroundColor: "var(--primary)" }}
htmlType="submit"
className="register-form-button"
>
Register now
</Button>
</FormItem>
</Form>
);
});