Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
react-native-picker
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ym
react-native-picker
Commits
66d131fc
Commit
66d131fc
authored
Jan 11, 2016
by
xwenliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add shouldComponentUpdate
parent
79f13530
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
12 deletions
+6
-12
index.js
index.js
+5
-11
package.json
package.json
+1
-1
No files found.
index.js
View file @
66d131fc
...
@@ -58,18 +58,12 @@ export default class PickerAny extends React.Component {
...
@@ -58,18 +58,12 @@ export default class PickerAny extends React.Component {
this
.
setState
(
newState
);
this
.
setState
(
newState
);
}
}
//todo
shouldComponentUpdate
(
nextProps
,
nextState
,
context
){
/*shouldComponentUpdate(props, state, context){
if
(
JSON
.
stringify
(
nextState
.
selectedValue
)
===
JSON
.
stringify
(
this
.
state
.
selectedValue
)){
let newProps = Object.assign({}, props);
return
false
;
let newState = Object.assign({}, state);
}
let oldProps = Object.assign({}, this.props);
return
true
;
let oldState = Object.assign({}, this.state);
}
let arr = [newProps, newState, oldProps, oldState];
for(let i in arr){
delete arr[i].slideAnim;
}
return JSON.stringify([newProps, newState, context]) !== JSON.stringify([oldProps, oldState, this.context]);
}*/
_getStateFromProps
(
props
){
_getStateFromProps
(
props
){
//the pickedValue must looks like [wheelone's, wheeltwo's, ...]
//the pickedValue must looks like [wheelone's, wheeltwo's, ...]
...
...
package.json
View file @
66d131fc
{
{
"name"
:
"react-native-picker"
,
"name"
:
"react-native-picker"
,
"version"
:
"0.
2.11
"
,
"version"
:
"0.
3.0
"
,
"description"
:
"react-native-picker"
,
"description"
:
"react-native-picker"
,
"main"
:
"index.js"
,
"main"
:
"index.js"
,
"scripts"
:
{
"scripts"
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment