Anyone have recommendation on simple-schema forms and form validation?
I’m considering using yup & react-formal…
or maybe formsy & formsy-react-components…
translating the simple-schema into a the other desired format/schema, and using “reacty” tools.
Anyone have experience with these tools? Want to suggest alternatives? Want to suggest approaches? Want to collaborate on the approach?
1 Like
I’m also curious to see what other people use for forms with react and simple schema.
Ok - I have not found a solution yet, so I started to make my own… this really could become a janky react autoform alternative… right now it’s just a draft, but it is rendering a formsy
form with the basics from a simple-schema
schema…
https://zeroasterisk.github.io/react-form-simple-schema
Still a lot to do. See the README for basic roadmap. Collaborators and PRs requested!!!
1 Like
Also in search of a good solution. Found redux-form. Will try it in the coming days.
If you use redux. Then this could be good. Also taking a look at your repo. Seems cool.
2 Likes
Yep - I’m also hacking away at it and JUST finally got things working well…
Here’s a npm
to convert simple-schema
into a validate
function for redux-form
And here’s a gist of Container > Page > ReduxForm(Component)
MyRequestInviteContainer.js
import { Meteor } from 'meteor/meteor';
import { Email } from 'meteor/email';
import { createContainer } from 'meteor/react-meteor-data';
import { Texts } from '../../../api/Texts/collection';
import { Users } from '../../../api/Users/collection';
import { schemaInviteRequest, sendInviteRequest } from '../../../api/Invites/methods';
import { Bert } from 'meteor/themeteorchef:bert';
This file has been truncated. show original
MyRequestInviteForm.js
import React, { Component, PropTypes } from 'react';
import { reduxForm } from 'redux-form';
import StaticField from '../../../ui/components/elements/StaticField';
import TextInput from '../../../ui/components/elements/TextInput';
import ButtonsField from '../../../ui/components/elements/ButtonsField';
class MyRequestInviteForm extends Component {
constructor(props) {
super(props);
This file has been truncated. show original
MyRequestInvitePage.js
import React from 'react';
import MyRequestInviteForm from '../components/RequestInviteForm';
export default class MyRequestInvitePage extends React.Component {
render() {
return (
<div>
<h1>Auth Request Invite</h1>
{this.props.currentUser && this.props.currentUser._id ?
<MyRequestInviteForm
This file has been truncated. show original
Note: the handlers are tricky and took a while to get right (for me), see comments in gist.
1 Like
Here is a new React forms package build using simple-schema. https://github.com/vazco/uniforms
2 Likes
@skirunman that looks very promising. I’m making a bootstrap4 UI version version to play with it. I could use a little help making my FormField wrapper work though… can you help me out a bit? (zeroasterisk on G+Hangout)
@zeroasterisk I’m not the developer. Looks like you have opened a couple of issues with Vazco so I’m sure they will get back to you on github.
Just an update, while housecleaning…
I did indeed adopt uniforms and have been super-happy. It’s very robust at this point and versatile, no meteor/redux/mobx lockin, but integrable with all of those, and the right amount of automagic & customization.
Automatic forms generation
Fields capable of rendering every schema
Helper for creating custom fields with one line
Inline and asynchronous form validation
Integrations with various schemas:
Wide range of themes:
1 Like