-
Notifications
You must be signed in to change notification settings - Fork 4.1k
style(Form): update typings and propTypes usage #1320
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
Conversation
} | ||
|
||
FormGroup.defaultProps = { | ||
as: 'div', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ElementType
is div
by default.
@@ -1,5 +1,3 @@ | |||
export type InputType = 'color' | 'date' | 'datetime' | 'datetime-local' | 'email' | 'number' | 'range' | 'search' | 'select' | 'password' | 'tel' | 'text' | 'time' | 'url' | 'week'; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cruft.
src/index.d.ts
Outdated
@@ -25,8 +23,6 @@ type SemanticWIDTHSSTRING = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | | |||
|
|||
export type SemanticWIDTHS = SemanticWIDTHSNUMBER | SemanticWIDTHSSTRING; | |||
|
|||
export type SemanticGenericOnClick = (event: any, value: any) => void; | |||
export type SemanticFormOnClick = (event: any, object: Object) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cruft.
bc5c7d2
to
f1a099d
Compare
Codecov Report
@@ Coverage Diff @@
## master #1320 +/- ##
==========================================
- Coverage 99.74% 99.74% -0.01%
==========================================
Files 140 140
Lines 2392 2390 -2
==========================================
- Hits 2386 2384 -2
Misses 6 6
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question before merging.
|
||
interface FormInputProps extends InputProps { | ||
interface FormInputProps extends FormFieldProps, InputProps { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, is this going to cause the duplicate property error again? Both FormFieldProps and InputProps define a label
prop in their interfaces, each with different types:
FormFieldProps
/** Mutually exclusive with children. */
label?: any | Object;
InputProps
/** Optional Label to display along side the Input. */
label?: any;
This may also be the case with Checkbox/Radio/Button, since they all accept a label prop as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems, you're right, I'll check it.
I've checked |
…React into style/form # Conflicts: # src/index.d.ts # test/specs/collections/Form/Form-test.js # test/specs/collections/Form/FormField-test.js # test/specs/collections/Form/FormFieldGroup-test.js
Rebased to |
What about this comment, do we still have the conflicting input prop typing issue due to the FormFieldProps extending the InputProps? |
Nope. |
Thanks, that was obvious :P |
Released in |
* style(Form): update typings and propTypes usage * style(Form): update typings and propTypes usage * style(Form): update typings and propTypes usage * style(typings): cleanups
This PR is part of work for removing propTypes in production bundle (#524, #731).
Also, cleanups and updates typings for #1072.
Fixes #1304.