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
Most of the controls have no breaking changes when moving from v1 to v2. However, some APIs were changed to make the library more stable and controls behavior more even.
3
-
Also, we've bumped up React and Fluent UI versions used in the library. It means you will need to update `package.json` file in your SPFx projects.
4
-
The below guide is an overview of what it takes to migrate from v1 to v2. If we missed something, please let us know in the issues list so we can update the guide. Thanks!
5
4
6
-
## v2 Supports SharePoint Online Only
7
-
v2 of Reusable Controls is based on SharePoint Framework 1.11 and, as a result, does not support SharePoint On-Premise. **Please, use v1 if you plan to deploy your solution on-prem.**
5
+
Also, we've bumped up React and Fluent UI versions used in the library. It means you will need to update the `package.json` file in your SPFx projects.
6
+
7
+
The below guide is an overview of what it takes to migrate from v1 to v2. If we missed something, please let us know on the issues list so we can update the guide. Thanks!
8
+
9
+
## v2 Supports SharePoint Online **only**
10
+
11
+
V2 of Reusable Controls is based on SharePoint Framework 1.11. Due to this change, it does not support SharePoint on-premises. **Please, use v1 if you plan to deploy your solution on-premises.**
8
12
9
13
## React and Fluent UI versions
10
-
v2 of Reusable Controls uses React.js v16.8.5 and Fluent UI (Office UI Fabric React) v6.214.0.
14
+
15
+
V2 of Reusable Controls uses React.js v16.8.5 and Fluent UI (Office UI Fabric React) v6.214.0.
16
+
11
17
Although it is not necessary to use the same modules' versions in your project, we highly recommend to update your solution accordingly:
18
+
12
19
```json
13
20
"dependencies": {
14
21
// other dependencies
@@ -21,25 +28,29 @@ Although it is not necessary to use the same modules' versions in your project,
21
28
"@types/react-dom": "16.8.3",
22
29
},
23
30
```
24
-
The easiest way to upgrade SharePoint Framework solution is to use [Office365 CLI](https://pnp.github.io/office365-cli/cmd/spfx/project/project-upgrade/#spfx-project-upgrade)`spfx project upgrade` command.
31
+
32
+
The easiest way to upgrade the SharePoint Framework solution is to use [Office365 CLI](https://pnp.github.io/office365-cli/cmd/spfx/project/project-upgrade/#spfx-project-upgrade)`spfx project upgrade` command.
25
33
26
34
## APIs Changes
35
+
27
36
### PeoplePicker
28
-
`isRequred` is renamed to `required`.<br/>
29
-
The property has been renamed to use the common approach for mandatory field naming.
30
37
31
-
`errorMessage` represents a static error message to be displayed in the control. <br />
32
-
In v1 `errorMessage` is used to provide the text that will be displayed if the field is set as `required` and no value is selected.
33
-
In v2 you can use this property to display an error message for whatever reason statically.
38
+
-`isRequired` is renamed to `required`
39
+
- The property has been renamed to use the common approach for mandatory field naming.
40
+
-`errorMessage` represents a static error message to be displayed in the control.
41
+
- In v1 `errorMessage` is used to provide the text that will be displayed if the field is set as `required` and no value is selected.
42
+
- In v2 you can use this property to display an error message for whatever reason statically.
43
+
34
44
```typescript
35
45
/**
36
46
* Static error message displayed below the text field. Use onGetErrorMessage to dynamically change the error message displayed (if any) based on the current value. errorMessage and onGetErrorMessage are mutually exclusive (errorMessage takes precedence).
37
47
*/
38
48
errorMessage?:string;
39
49
```
40
50
41
-
`onGetErrorMessage` to get error message dynamically.<br />
42
-
The method is used to get the validation error message and determine whether the input value is valid or not. Mutually exclusive with the static string errorMessage (it will take precedence over this).
51
+
-`onGetErrorMessage` to get error messages dynamically.
52
+
- The method is used to get the validation error message and determine whether the input value is valid. Mutually exclusive with the static string errorMessage (it will take precedence over this).
53
+
43
54
```typescript
44
55
/**
45
56
* The method is used to get the validation error message and determine whether the picker value is valid.
@@ -58,9 +69,7 @@ The method is used to get the validation error message and determine whether the
0 commit comments