Closed joewood closed 9 years ago
tcomb-form v0.3 playground
The playground is outdated, sorry for that
Thanks, I'm seeing the same thing from the current version of tcomb-form in npm: 0.6.3 Do I need to clone and build?
This is working for me (v0.6.3):
const Foo = t.struct({
date: t.Date
});
const App = React.createClass({
onSubmit(evt) {
evt.preventDefault();
var value = this.refs.form.getValue();
if (value) {
console.log(value);
}
},
render() {
return (
<form onSubmit={this.onSubmit}>
<t.form.Form
ref="form"
type={Foo}
/>
<button className="btn btn-primary">Save</button>
</form>
);
}
});
I see this:
Funny, I don't see that. Is it t.Date
or t.Dat
?
I've tried both and neither worked for me. I tried the playground because I thought it may be a bootstrap set-up issue.
Is it t.Date or t.Dat ?
It's the same, they are aliases.
I've tried both and neither worked for me
Weird...I'm scratching my head, I dont know how to help you out
Could you advise on which bootstrap scripts/CSS files you use? Are there any other dependencies there for the bootstrap templates? Are there any other set-up requirements - or should this work out of the box? Appreciate any help, thanks.
which bootstrap scripts/CSS files you use
Bootstrap v3.3.1
Are there any other dependencies there for the bootstrap templates
Those declared in the package.json
Are there any other set-up requirements - or should this work out of the box?
It should work out of the box.
Last thing I can try is to put up a new clean project and start from the ground up with the example above, let's see if I'm able to replicate your issue, otherwise it's probably something in your configuration...
That would be great. I'm using bootstrap 3.3.5 from their CDN, but the other dependencies are all in the bundle, built using webpack.
Last thing I can try is to put up a new clean project and start from the ground up with the example above, let's see if I'm able to replicate your issue
Nope, everything's fine on my side
thanks - any chance you could post that code so I can compare? I tried an empty new project and I'm still seeing the issue.
Sure, let me put up a temporary repo on GitHub, stay tuned
Thanks, that nailed it. I was using tcomb rather tcomb-form for the data-types. There must be a conflict somewhere. Really appreciate the help!
Great, happy hacking.
Giulio
Looking at the playground: http://gcanti.github.io/resources/tcomb-form/playground/playground.html When I add a t.Dat field, I only see a textbox? Is this the default behavior?