-
-
Notifications
You must be signed in to change notification settings - Fork 118
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Clear and concise description of the problem
exportProps problem
Suggested solution
declare global {
type Prop<T, Default extends T | undefined = undefined> = Default extends T ? T : (T | undefined)
}
/** with default **/
declare let modelValue: Prop<number, 0>
/** that prop is required: false **/
declare const show: Prop<boolean>
/** that prop is required: true **/
declare const title: string
const inc = () => {
modelValue += 1
}
/** expose */
export const dec = () => {
modelValue -= 1
}
/** render **/
export default () => <div title={title} onClick={inc}>{modelValue}</div>Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Groupguanfang and zhiyuanzmj
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request