arqex / arqex/react-datetime

Change `input` props name to anything for redux form purpose

Open
#540 1 comment 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
2k
Forks
858
PR merge metrics
No merged PRs in 30d

Description

Hi, thank you for an awesome component you provides.
I tried to integrate this component with redux-form :
```
import * as React from "react";
import { WrappedFieldProps, Field, GenericField } from "redux-form";
import { Label } from "semantic-ui-react";
import * as DateTime from "react-datetime";

export const DatePickerField = Field as new () => GenericField;

export function RenderDatePickerField(props: WrappedFieldProps & DateTime.DatetimepickerProps) {
return (



{
props.meta.touched && ((props.meta.error &&
{props.meta.error}) || (props.meta.warning &&
{props.meta.warning}))
}

);
}

```

it works perfectly fine, but when i tried to use the component like this:
```

```

The `input` props for Datetime props overrides `WrappedFieldProps` which also contains `input` props. I need redux-form's `input` props to trigger `onChange` method they also provides.

So could you please change the `input` props to anything other than `input` 😄

Contributor guide

Open the contributing guide

Research direction

Start with the DateTime component's public props and the path that consumes its input prop. Determine how the prop can be renamed without colliding with redux-form's input object; done means the shown DatePickerField integration can preserve redux-form's onChange behavior without the collision.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.