Skip to content
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

[Component] Single error field #13

Closed
serkandurusoy opened this issue May 27, 2016 · 2 comments
Closed

[Component] Single error field #13

serkandurusoy opened this issue May 27, 2016 · 2 comments
Assignees
Labels
Type: Feature New features and feature requests

Comments

@serkandurusoy
Copy link
Contributor

I see that there is a component, ErrorsField, for displaying all error messages but I could not spot a component to display a single error message for a given field.

Trying to achieve aldeed:autoform's affieldmessage helper, would this work? And if it did, could we add it to the standard packaging?

import React          from 'react';
import {connectField} from 'uniforms';

const Error = ({
    errorMessage,
    ...props
}) =>
    <section {...props}>
        {errorMessage && (
            {errorMessage}
        )}
    </section>
;

export default connectField(Error);
@radekmie radekmie self-assigned this May 27, 2016
@radekmie
Copy link
Contributor

Yes, that's neat. Also, your implementation is almost perfect - <section> shouldn't receive onChange. I'll add it soon.

@serkandurusoy
Copy link
Contributor Author

Wow, thanks! And thank you also for pointing out my oversight. It helps me think about how I design new components, which I will probably do over the coming weeks.

@radekmie radekmie added the Type: Feature New features and feature requests label May 28, 2016
@Monteth Monteth added this to Closed in Open Source (migrated) Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New features and feature requests
Projects
Archived in project
Development

No branches or pull requests

2 participants