Skip to content

Commit d619062

Browse files
authored
Merge pull request arqex#713 from ianbrown78/patch-1
Fixes readme typos
2 parents 561e35a + fd3b4e5 commit d619062

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

migrateToV3.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Migrate react-datetime to v3
22

3-
A new decade has begun and a new mayor version of react-datetime is released. It's been some years since the first release of v2 and a lot has changed in the react ecosystem.
3+
A new decade has begun and a new major version of react-datetime is released. It's been some years since the first release of v2 and a lot has changed in the react ecosystem.
44

55
In v3 we have updated the whole base code of react-datetime, catching up with the latest tools and practices. We can proudly say that this is the best performant, most customizable and easiest to understand version of the library so far. This version also makes the mantainance of react-datetime much simpler, this way we are ready to keep shipping new features and improvements.
66

@@ -23,20 +23,20 @@ It might seem to be working ok but [some props have changed](#whats-new-in-react
2323

2424
We should better search for the following props in our code and replace them as recommended in the points below:
2525
* Search for `defaultValue` prop in your datetime code. Remame it to `initialValue`.
26-
* Search for `defaultViewDate` props and replace them by `initialViewDate`.
27-
* Search form `viewMode` props and replace them by `initialViewMode`.
28-
* Search for `disableCloseOnClickOutside`. If you are using it, replace it for `closeOnClickOutside={false}`.
29-
* Search for `<Datetime>` components using `onBlur` or `onFocus`. Replace those props by `onClose` or `onOpen`. `onOpen` doesn't receive any paramter anymore, so don't try to access to them.
30-
* Search for `onViewModeChange`. If you find it, rename it by `onNavigate`.
31-
* Search for `Datetime.setView`. If you were using this imperative method, replace it by `Datetime.navigate`.
26+
* Search for `defaultViewDate` props and replace them with `initialViewDate`.
27+
* Search for `viewMode` props and replace them with `initialViewMode`.
28+
* Search for `disableCloseOnClickOutside`. If you are using it, replace it with `closeOnClickOutside={false}`.
29+
* Search for `<Datetime>` components using `onBlur` or `onFocus`. Replace those props with `onClose` or `onOpen`. `onOpen` doesn't receive any parameters anymore, so don't try to access to them.
30+
* Search for `onViewModeChange`. If you find it, rename it to `onNavigate`.
31+
* Search for `Datetime.setView`. If you were using this imperative method, replace it with `Datetime.navigate`.
3232

3333
Those are the main changes that might break your app, if you weren't able to find any of those, react-datetime v3 should keep working as usual in your project.
3434

3535
## What's new in react-datetime v3
3636
Version 3 is a big refactor of react-datetime. We have tried to not to change the API drastically, but some of the props has been renamed or removed, trying to make them clearer for the developer. A complete list of changes is:
3737

3838
* The props are read directly when possible, not deriving the state from them anymore.
39-
* The props that were used to set initial values, like `defaultValue`, `viewDate` or `viewMode` are renamed with the `initial` prefix to express better their intention. `initialValue`, `initialViewDate`, `initialViewMode`.
39+
* The props that were used to set initial values, like `defaultValue`, `viewDate` or `viewMode` are renamed with the `initial` prefix to better express their intention. `initialValue`, `initialViewDate`, `initialViewMode`.
4040
* `disableCloseOnClickOutside` prop is now `closeOnClickOutside` (avoid double negations).
4141
* `onBlur` and `onFocus` props are renamed to `onClose` and `onOpen` since they had nothing to do with the blur event and it was misleading for some users. If we want to listen to the input's `onBlur` and `onFocus` use `inputProps`.
4242
* Time is not updated anymore on right clicks.

0 commit comments

Comments
 (0)