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

refactor(core/presentation): use render props everywhere #7316

Conversation

christopherthielen
Copy link
Contributor

In FormField and FormikFormField, always use render prop to render the input and layout. Do not pass class references.

In FormField and FormikFormField, always use render prop to render
the input and layout.  Do not pass class references
errors.email = 'Please enter a valid email';
}
return errors;
const emailRegexp = /[^@]+@[^@]+/;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactored this to use buildValidators

export function renderContent<T>(Content: string | JSX.Element | React.ComponentType<T>, props: T): React.ReactNode {
const prototype = typeof Content === 'function' && Content.prototype;

if (prototype && (prototype.isReactComponent || typeof prototype.render === 'function')) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed rendering of class components via a class reference

Copy link
Contributor

@alanmquach alanmquach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@christopherthielen christopherthielen merged commit 40c3197 into spinnaker:master Aug 13, 2019
@christopherthielen christopherthielen deleted the formik-form-field-always-use-render-prop branch August 13, 2019 18:36
christopherthielen added a commit to christopherthielen/deck that referenced this pull request Aug 13, 2019
40c3197 refactor(core/presentation): use render props everywhere (spinnaker#7316)
cef1c09 fix(core/presentation): prevent the hover jitters on pipeline graph labels (spinnaker#7311)
74ea2e7 fix(ui): require application, pipeline, and a status when adding a pipeline trigger (spinnaker#7308)
f3de167 fix(ui): require type on the stage (spinnaker#7304)
834f4ea feat(helm): allow manual execution overrides for helm charts (spinnaker#7312)
ea29d8d fix(tasks): Not bothering with null user when we have an authed one (spinnaker#7305)
christopherthielen added a commit that referenced this pull request Aug 13, 2019
40c3197 refactor(core/presentation): use render props everywhere (#7316)
cef1c09 fix(core/presentation): prevent the hover jitters on pipeline graph labels (#7311)
74ea2e7 fix(ui): require application, pipeline, and a status when adding a pipeline trigger (#7308)
f3de167 fix(ui): require type on the stage (#7304)
834f4ea feat(helm): allow manual execution overrides for helm charts (#7312)
ea29d8d fix(tasks): Not bothering with null user when we have an authed one (#7305)
erikmunson pushed a commit to erikmunson/deck that referenced this pull request Aug 14, 2019
40c3197 refactor(core/presentation): use render props everywhere (spinnaker#7316)
erikmunson pushed a commit that referenced this pull request Aug 14, 2019
* chore(amazon): Bump version to 0.0.208

40c3197 refactor(core/presentation): use render props everywhere (#7316)

* chore(titus): Bump version to 0.0.108
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants