Skip to content

Conversation

@artawood
Copy link
Contributor

@artawood artawood commented Jan 12, 2020

This is to add to the documentation an example of react hook for usage and add clarity to how the date is retrieved with params (event, date) and displayed from property value via data.value

Closes #144.

@vercel
Copy link

vercel bot commented Jan 12, 2020

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/arthurdenner/react-semantic-ui-datepickers/cblwckclim
✅ Preview: In Progress

@arthurdenner
Copy link
Owner

@artawood, your PR is on point, thank you!

I was thinking, could you fix the typo in data and replace the two current examples considering a hook usage, please? I think it makes more sense. For example, the basic example can be:

const AppWithBasic = () => {
  const [currentDate, setNewDate] = useState('');
  const onChange = (event, data) => setNewDate(data.value);

  return <SemanticDatepicker onChange={onChange} />;
};

@artawood
Copy link
Contributor Author

@arthurdenner, typo is fixed, and I updated the two examples with hook usage. I hope the second example is more helpful as it add clarity the expected value retrieved for the range is an array.

Copy link
Owner

@arthurdenner arthurdenner left a comment

Choose a reason for hiding this comment

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

@artawood, yes, the second example is nice.

I noticed one minor thing that was my mistake when giving you the example.
Can you accept the suggestion, please?

After this, I'll merge it. Thanks!

@arthurdenner
Copy link
Owner

Thank you for your contribution, @artawood! 🎉

@arthurdenner
Copy link
Owner

@all-contributors please add @artawood for doc.

@allcontributors
Copy link
Contributor

@arthurdenner

I've put up a pull request to add @artawood! 🎉

@artawood
Copy link
Contributor Author

@arthurdenner Thanks! Happy to contribute! 👍

@arthurdenner
Copy link
Owner

🎉 This PR is included in version 2.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to get value of inputted date?

2 participants