Meteor-Community-Packages / meteor-autoform

AutoForm is a Meteor package that adds UI components and helpers to easily create basic forms with automatic insert and update events, and automatic reactive validation.
MIT License
1.44k stars 328 forks source link

Upgraded to latest autoform and NPM version of Simpl-Schema no validation messages #1679

Closed TechplexEngineer closed 5 years ago

TechplexEngineer commented 5 years ago

Not sure where the best place to put this is but I just spent a considerable amount of time trying to figure out how to get my validation to show up the "has-error" class and error text.

I learned that it was a s simple as adding { tracker: Tracker } to the new SimpleSchema() call like this:

import { Tracker } from 'meteor/tracker';

const schema = new SimpleSchema({
    name: {
        type: String,
    }
}, { tracker: Tracker });

For anyone migrating from aldeed:simple-schema to npm simpl-schema:

TechplexEngineer commented 5 years ago

Moral of the story... read the release notes better: https://github.com/aldeed/meteor-simple-schema/blob/master/CHANGELOG.md#200