-
-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug with react-form@1.0.0-beta1 #30
Comments
Ah, I've just missed that API is changed and it should be used different way... |
Ahh, what changed? I'm getting the same error, might be nice to put a solution for others who come here. |
What error are you seeing?
…On Sat, Jan 28, 2017 at 11:31 AM Tim ***@***.***> wrote:
Ahh, what changed? I'm getting the same error, might be nice to put a
solution for others who come here.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFUmCVyegSCPcmbeymbFpwLiSGZXqO3Iks5rW4mSgaJpZM4Ltfqs>
.
|
The same one in the OP: Dying on which was working great previously. |
The new import { Form } from 'jumpsuit'
export default (
<Form
defaultValues={{...}}
validate={(values) => {...}}
...
>
{(api) => (
<div>
...your form compoment
</div>
)}
</Form>
) |
Okay cool, thanks. I was only able to get it going by exporting a function like this:
|
Right. That's intended. So basically, you could make your own factory like the old one by doing something like: export default function FormFactory (props) {
return (component) => <Form {...props}>{component}</Form>
}
// Usage
const MyForm = FormFactory(defaults)(component)
(
<MyForm validate={() => {...}} />
) |
Hrmm, it's late and I'm overlooking something trying to get a Factory going based of that example. FormFactory.js
RegisterForm.js
|
In that scenario, you would have pass <RegisterForm/> instead of
RegisterForm
…On Sat, Jan 28, 2017 at 10:33 PM Tim ***@***.***> wrote:
Hrmm, it's late and I'm overlooking something trying to get a Factory
going based of that example.
I keep getting expected a string (for built-in components) or a
class/function (for composite components) but got: object.. I've tried
wrapping the FormFactory export in a function, and while I don't get an
error that way, I also don't get any Form content.
FormFactory.js
import React, { PropTypes } from 'react';
import { Form } from 'react-form';
export default function FormFactory(props) {
return (component) => <Form {...props}>{component}</Form>;
}
RegisterForm.js
class RegisterForm extends Component {
render() {
return (
<form>
<div className="grid1">
.....
export default FormFactory({
validate: validateMethods,
defaultValues: {
test: true,
}
})(RegisterForm)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFUmCUPtdrU5k6zlLYT24vBOPd-DsqYEks5rXCS6gaJpZM4Ltfqs>
.
|
Yep, that's what I'd thought as well. Doing that still gives The component that FormFactory gets ends up being |
is there any migration guide for this??? |
migration guideold versions:
should become like:
|
I've tried to update react-form plugin to beta1, but after update, I'm receiving this error:
Which tracks to this line in React:
Have you successfully used plugin with React 15.4.2?
Any ideas how to solve this?
UPD:
Last working version for me is 0.11.1
It seems somewhere in this commit?
cdd4bbd
The text was updated successfully, but these errors were encountered: