You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you submitting a bug report or a feature request?
I am not sure if this is the right repo for this but I really don't want to submit this issue to DefinetelyTyped which has gazillion of things going on.
Consider the component below which is on TypeScript:
import*asReactfrom'react';import{reduxForm,Field,FormErrors,FormProps}from'redux-form';interfaceFormData{name?: string;lastname?: string;}constvalidate=(values: Readonly<FormData>): FormErrors<FormData>=>{consterrors: FormErrors<FormData>={};if(values.name===undefined){errors.name='name needed';}if(values.lastname===undefined){errors.lastname='lastname needed';}returnerrors;};interfaceSelectionWithFormProps{readonlyvalue: string;readonlyonChange: (val: React.ChangeEvent<HTMLSelectElement>|React.FormEvent<HTMLSelectElement>|string)=>void;}classSelectionWithFormextendsReact.Component<FormProps<FormData,{},{}>&SelectionWithFormProps,{}>{render(): JSX.Element{return<div><div><Fieldplaceholder="First name"name="name"component="input"/><Fieldplaceholder="Last name"name="lastname"component="input"/><div><buttonclassName="button button--primary"type="button"onClick={this.props.handleSubmit}>
Provide full name
</button></div></div></div>;}}exportdefaultreduxForm<Readonly<FormData>,SelectionWithFormProps,{}>({form: 'SelectionWithForm',validate: validate,onSubmit: (values,dispatch,props)=>{console.log('submit is being handled...');props.onChange(values.name+' '+values.lastname);}})(SelectionWithForm);
What is the current behavior?
When you try to consume this, you will see that redux form properties are also available to consumer:
which I imagine does not make sense and more importantly then IntelliSense, this effects the compilation, too.
What is the expected behavior?
I would expected it to just expose SelectionWithFormProps as the shape for valid props to pass through SelectionWithForm.
Are you submitting a bug report or a feature request?
I am not sure if this is the right repo for this but I really don't want to submit this issue to DefinetelyTyped which has gazillion of things going on.
Consider the component below which is on TypeScript:
What is the current behavior?
When you try to consume this, you will see that redux form properties are also available to consumer:
which I imagine does not make sense and more importantly then IntelliSense, this effects the compilation, too.
What is the expected behavior?
I would expected it to just expose
SelectionWithFormProps
as the shape for valid props to pass throughSelectionWithForm
.Sandbox Link
You can see the sample here: https://github.com/tugberkugurlu/redux-form-typescript-repro/tree/2f1ef56d3ac6c7d2df4dcba950f871fd72d8a925 follow the readme on how to get it up and running.
You should be able to open it up on VS Code to observe the IntelliSense behavior. You can also trigger the compilation through
npm run build
What's your environment?
redux-form
: 6.5.0@types/redux-form
: 6.3.2typescript
: 2.2.1Node.js
: 4.4.7The text was updated successfully, but these errors were encountered: