This repository has been archived by the owner on Dec 11, 2020. It is now read-only.
forked from JedWatson/react-select
-
Notifications
You must be signed in to change notification settings - Fork 0
3055 do not recreate cx and getValue functions during render of Select component #16
Open
manvydasu
wants to merge
262
commits into
react-select-oss:master
Choose a base branch
from
manvydasu:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
262 commits
Select commit
Hold shift + click to select a range
3f82ae5
Merge pull request #4294 from JedWatson/fix-circle-ci
bladey 442596e
Fix getPortalPlacement in PortalPlacementContext
JedWatson 7720401
Fix menuShouldScrollIntoView in MenuPortal example
JedWatson 7af1aaf
Add changeset
JedWatson 665443b
Merge branch 'master' into fix-menuplacement-context
bladey 709b0bc
Merge pull request #4295 from JedWatson/fix-menuplacement-context
bladey ca66253
Version Packages
github-actions[bot] c5937f3
Merge branch 'master' into master
bladey 55b1770
Merge branch 'master' into master
JedWatson 17b406a
Merge pull request #3980 from JedWatson/changeset-release/master
JedWatson f29e5ca
Merge branch 'master' into master
JedWatson 3b53d7a
Merge pull request #4240 from jayeshmann/master
JedWatson 1ef2517
Bump dot-prop from 4.2.0 to 4.2.1
dependabot[bot] 0bb2de3
Bump tar-fs from 1.16.0 to 1.16.3
dependabot[bot] 2c35314
Merge branch 'master' into master
bladey ab760f7
Adds review fixes
majgaard 9460a6f
Merge pull request #4296 from JedWatson/dependabot/npm_and_yarn/dot-p…
bladey c488a78
Merge branch 'master' into dependabot/npm_and_yarn/tar-fs-1.16.3
bladey 3d040c5
Bump websocket-extensions from 0.1.3 to 0.1.4
dependabot[bot] 99b02d7
Merge pull request #4205 from JedWatson/dependabot/npm_and_yarn/webso…
bladey b54244e
Merge branch 'master' into dependabot/npm_and_yarn/tar-fs-1.16.3
bladey c4b3090
Merge pull request #4204 from JedWatson/dependabot/npm_and_yarn/tar-f…
bladey f350b69
Bump node-fetch from 2.6.0 to 2.6.1
dependabot[bot] 2d13c1f
Merge pull request #4212 from JedWatson/dependabot/npm_and_yarn/node-…
bladey 41d683d
Update Creatable.js
bladey 72f6036
Create ten-apples-tap.md
bladey 315de17
Merge branch 'master' into patch-1
bladey 998c979
Merge pull request #4306 from JedWatson/fix-docs-createOptionPosition
ebonow 8ef7ce4
PR#4233-Fix broken example
4fe4485
Remove UNSAFE_componentWillReceiveProps from Async
Methuselah96 edc14e4
Remove UNSAFE_componentWillReceiveProps from Creatable
Methuselah96 4494861
Apply automatic Prettier changes in Select
Methuselah96 869c10f
Move components to getComponents() getter
Methuselah96 56824dc
Make menuOptions calculated instead of storing it in state
Methuselah96 0258620
Move methods necessary for getDerivedStateFromProps out of class
Methuselah96 42d3518
Fix bug where the isOptionDisabled builtin was incorrectly called
Methuselah96 d2919c7
Refactor buildMenuOptions and move it out of the class
Methuselah96 c2a1137
Switch to getDerivedStateFromProps
Methuselah96 b2488bb
Create purple-moons-promise.md
Methuselah96 daaad67
Remove unnecessary state parameters
Methuselah96 c14f591
Preserve indices to match previous behavior
Methuselah96 13c2b6a
Memoize buildCategorizedOptions
Methuselah96 ebf1c04
Restore memoization of getComponents()
Methuselah96 2303fdf
Update changeset
Methuselah96 384ca8c
Memoize buildFocusableOptions as well
Methuselah96 ee638d4
Create great-actors-end.md
Methuselah96 a2172f0
Merge pull request #4316 from JedWatson/#4233-Update-CustomNoOptionsM…
Methuselah96 b13c7cd
Bump ini from 1.3.5 to 1.3.7
dependabot[bot] 0fb40ab
Merge pull request #4324 from JedWatson/dependabot/npm_and_yarn/ini-1…
Methuselah96 c03527a
Merge branch 'master' into remove-unsafe-react
Methuselah96 6f56afe
Merge branch 'master' into patch-1
JedWatson e97aafc
Merge pull request #4275 from jakeherp/patch-1
JedWatson 7a56e45
Merge branch 'master' into master
JedWatson c615e93
Added changeset
JedWatson 20e8d5a
Merge pull request #4084 from manvydasu/master
JedWatson ad890f2
Update react-input-autosize (#4326)
Methuselah96 24ba870
add innerProps to MenuList (#4289)
slimklim 52ec1c1
Update purple-moons-promise.md
Methuselah96 a0133f1
Fix removing MultiValues that have identical values. Issue #4137 (#4154)
brenshanny d1e660c
protect against reading removeEventListener from el if null (#4213)
eythort 482039a
4255: Check props to ensure Select is not focused when isDisabled cha…
ff0cf1c
Resolves Flow issues
majgaard 27e1c32
Merge branch 'master' into deps/upgrade-emotion
Methuselah96 82be3a7
Merge branch 'master' into patch-2
Methuselah96 fcdeb2b
Pass [] instead of null in onChange when no values on multi-select
Methuselah96 ffb4740
Change
Methuselah96 0205067
Create dry-pumas-complain.md
Methuselah96 41c9ebb
#3006: Documentation clarifications and defining components section
82c82fa
Remove style changes
Methuselah96 2c0885f
Indecisive
Methuselah96 571c2cc
Fix linting spaces and semi-colons
aa01542
Fix test
Methuselah96 25c9219
Standardize innerProps and className props on customizable components
Methuselah96 18cfb5e
Reorder
Methuselah96 b5f9b0c
Create fast-eagles-perform.md
Methuselah96 076cbc8
Update fast-eagles-perform.md
Methuselah96 23be4c1
Fix types
Methuselah96 7206bbb
Fix more types
Methuselah96 db13938
Revert "Restore memoization of getComponents()"
Methuselah96 896a845
Merge branch 'master' into remove-unsafe-react
Methuselah96 8e8397f
Enforce prettier in CI (#4338)
Methuselah96 b11ffb8
Merge branch 'master' into on-change-null
JedWatson 7bbcbab
Merge branch 'master' into #3006-Documentation-Additions-and-Revisions
JedWatson cec530e
Merge branch 'master' into menu-portal-class-name
Methuselah96 90f2e68
Merge branch 'master' into Issue-4255--Remove-focus-from-disabled-Select
JedWatson 9aef92d
Merge branch 'master' into patch-2
Methuselah96 b28d992
Fix onCreateOption is not always called for Creatable (#3990)
nikitaindik 215e3d9
Merge branch 'master' into Issue-4255--Remove-focus-from-disabled-Select
Methuselah96 f606436
Merge branch 'master' into patch-2
Methuselah96 a1b8d84
Merge branch 'master' into menu-portal-class-name
Methuselah96 db7489e
Add NPM scripts to write and check Prettier
Methuselah96 94a0bb2
Merge branch 'master' into #3006-Documentation-Additions-and-Revisions
Methuselah96 17680f6
Make Prettier changes
Methuselah96 b309ba8
Make Prettier changes
Methuselah96 2ad29d6
Create quick-carrots-count.md
Methuselah96 57ed3e3
Pass down extra props to group header as item.data (#3046)
akre54 a1e1db2
Fix value passed to onChange when clearing values (#4373)
Methuselah96 a2971e6
Merge branch 'master' into Issue-4255--Remove-focus-from-disabled-Select
JedWatson ad2ff6c
4255: Check props to ensure Select is not focused when isDisabled cha…
JedWatson b27d01b
Merge branch 'master' into patch-2
JedWatson ef2d357
Merge pull request #4136 from jkjustjoshing/patch-2
JedWatson 9c4dec3
Merge branch 'master' into #3006-Documentation-Additions-and-Revisions
JedWatson 500398d
Merge pull request #4340 from JedWatson/#3006-Documentation-Additions…
JedWatson 244fa36
Merge branch 'master' into add-prettify-script
JedWatson 8c3de14
Merge pull request #4374 from Methuselah96/add-prettify-script
JedWatson 4ecdc9b
Version Packages
github-actions[bot] 45f6f29
Merge pull request #4307 from JedWatson/changeset-release/master
JedWatson cbff9a0
Renames key to cacheKey, updates changeset
majgaard 52b0230
Merge `ScrollBlock` and `ScrollCaptor` into `ScrollManager`
Rall3n 99a2bcb
Resolve linting errors
Rall3n 391a4f6
Missing `lockEnabled` prop in render method
Rall3n 12a2c7a
Remove obsolete components
Rall3n 4674763
Apply prettier changes
Rall3n b573dca
Swaps jest-emotion for @emotion/jest
majgaard 3977fc4
Merge branch 'master' into remove-unsafe-react
Methuselah96 a2e4d96
Changes from merge conflict
Methuselah96 1fec666
Fix typo
Methuselah96 e7fd12e
useHandle prop on SortableHOC example to prevent dragging on multiVal…
ebonow 70ef91e
Merge branch 'master' into on-change-null
Methuselah96 07a3997
Update
Methuselah96 5de4087
Merge branch 'master' into menu-portal-class-name
Methuselah96 5dd8381
Remove memoization of buildMenuOptions
Methuselah96 2e8473b
Prettier wants a comma
ebonow 2d5496d
Create beige-eagles-jog.md
Methuselah96 ed61064
fix data reference
ebonow 0dbf043
Add changeset
ebonow 7cdb8a6
Pass and sanitize CommonProps passed to Group and Input
ebonow d36a27f
Merge branch 'master' into deps/upgrade-emotion
JedWatson fd12983
Update olive-toys-try.md
Methuselah96 cb4b948
Merge pull request #4339 from Methuselah96/on-change-null
JedWatson e5151bb
Merge branch 'master' into deps/upgrade-emotion
JedWatson c7041f2
Merge pull request #4283 from majgaard/deps/upgrade-emotion
JedWatson 7d7cbe4
Merge branch 'master' into remove-unsafe-react
JedWatson ed3fe2e
Merge branch 'master' into findDOMNode-ScrollManager
Methuselah96 6db74e1
Update import for Emotion v11
Methuselah96 b132a87
Make ScrollManager a functional component
Methuselah96 fd93b6a
eslint-plugin-react-hooks
Methuselah96 e0335ef
Remove useCallback
Methuselah96 cc7cf9b
Finish useScrollCapture
Methuselah96 e406c87
Finish useScrollLock
Methuselah96 eb00026
Cleanup
Methuselah96 1c60ba4
Merge pull request #4313 from Methuselah96/remove-unsafe-react
JedWatson ff74140
Merge branch 'master' into remove-build-menu-options-memoization
Methuselah96 0e4634b
Merge pull request #4388 from Methuselah96/remove-build-menu-options-…
JedWatson 28ee545
Merge branch 'master' into findDOMNode-ScrollManager
JedWatson 7c54eb1
Merge pull request #4330 from Rall3n/findDOMNode-ScrollManager
JedWatson 4bcfb1b
Merge branch 'master' into scroll-manager-hooks
JedWatson c6f4b74
Merge pull request #4333 from Methuselah96/scroll-manager-hooks
JedWatson 4f9eccd
Cleaning up old TODOs
JedWatson 0071ff2
Delete .sweet-changelogs.js
JedWatson 454b788
Update copyright and credits
JedWatson c8649e5
Minor website styling fix
JedWatson 55d0687
Update README.md
JedWatson e297aa1
Run prettier
JedWatson 5baba46
Version Packages
github-actions[bot] 4da6ee0
Merge pull request #4392 from JedWatson/changeset-release/master
JedWatson 19b7634
Add `removedValues` into `onChange` `clear` action meta
eugenet8k 645feb3
Fix key for options within groups (#4396)
Methuselah96 e7bafee
Version Packages (#4397)
github-actions[bot] dc9f1b2
Merge branch 'master' into clear-action-arguments
eugenet8k 44f285b
Fix building focusable options from groups (#4399)
Methuselah96 a62f1aa
Version Packages (#4400)
github-actions[bot] 5bf8f67
aira-live branch changes applied to react-select branch v4.0.2
ebonow 7b7e413
Update custom aria message example
ebonow 36ba1d3
Add test coverage for accessilibity when isMulti
ebonow b3f0860
Merge branch 'master' into clear-action-arguments
eugenet8k 6e7fead
Remove dependency on @emotion/css
Methuselah96 10b5f5a
Create pretty-carpets-mix.md
Methuselah96 7532d4d
Merge pull request #4404 from Methuselah96/remove-emotion-css
JedWatson 2baf5a9
Refactor to move all accessibility functionality to new LiveRegion c…
ebonow 57a9f65
Minor clean-up of comments
ebonow 02e788a
selected may be null onClear
ebonow aef1b8a
Merge branch 'master' into aria-messages-v4
ebonow b0e999e
Enhancement: added npm install instructions.
JaydenElliott 5f0f2ec
Bump dependency on @babel/runtime
Methuselah96 a016c87
Create lovely-dingos-own.md
Methuselah96 d81ef3f
Only include focusable options from group
Methuselah96 a8724c4
Add test
Methuselah96 f600d13
Create eighty-lemons-happen.md
Methuselah96 d48fafa
Merge pull request #4422 from Methuselah96/fix-focusable-options
JedWatson 63bb04a
Update lovely-dingos-own.md
Methuselah96 3fd3b8e
Update lovely-dingos-own.md
Methuselah96 a496e40
Merge branch 'master' into babel-runtime
JedWatson 7c44a99
Merge pull request #4420 from Methuselah96/babel-runtime
JedWatson 11aea80
Merge branch 'master' into menu-portal-class-name
JedWatson 57d6c3c
Merge pull request #4342 from Methuselah96/menu-portal-class-name
JedWatson 5872930
Update pink-cats-mate.md
JedWatson 43c8330
Merge branch 'master' into clear-action-arguments
JedWatson ee4527c
Merge pull request #3911 from eugenet8k/clear-action-arguments
JedWatson 7b7920b
Merge branch 'master' into sortable-select-example
JedWatson 2c5bbc1
Merge pull request #4387 from JedWatson/sortable-select-example
JedWatson 0a84b7b
Merge branch 'master' into master
JedWatson ae79eed
Remove browser alias fields
Methuselah96 dce3863
Create perfect-pandas-argue.md
Methuselah96 335ca17
Update caniuse-lite browserlist
ebonow 12a18e7
Render single context node, add recommended attributes per #3353
ebonow f5fe8f9
Do not add mention options count if menuIsClosed per issue #4411
ebonow b41ba23
Fixed typo in Option docs (#4406)
Reflex-Gravity 6f0b424
Version Packages (#4405)
github-actions[bot] 9801a7f
Announce menu option is selected if focused, add tests. Resolves issu…
ebonow 7efc106
search for option in selectValue
ebonow 36cb3c1
Merge branch 'master' into master
JaydenElliott c955415
Deeclare event listeners as non-passive to remove Chrome browser warn…
ebonow 0680ae6
Merge branch 'master' into add-non-passive-event-listeners
ebonow 2962385
Merge pull request #4417 from JaydenElliott/master
JedWatson 8ae245b
Use accessor props to get value and label in `compareOption`
Rall3n 9aaf35b
Add polyfill for passive event listeners
ebonow 7c19c99
Allow tabIndex type to be number or string
ebonow ec7c072
Add changeset
ebonow 2ffed9c
Add changeset
Rall3n 3c3145c
Fix typo in `docs/pages/components`
hazem3500 88cb46a
Merge pull request #4444 from Rall3n/compare-option-accessors
JedWatson 7891f32
Merge branch 'master' into add-non-passive-event-listeners
JedWatson 258dde1
Add aria-live prop to customize attribute on LiveRegion
ebonow 4fb7988
update snapshots
ebonow 7e588e5
export defaultAriaLiveMessages as object
ebonow e5f6f93
switch to useMemo instead of useState and get some props from selectP…
ebonow cb21926
Refactor formatting functions to have one object prop, add prop comments
ebonow 6585829
Fix props typo
ebonow 711967a
Merge pull request #4437 from JedWatson/add-non-passive-event-listeners
JedWatson 25a27d8
Merge branch 'master' into add_missing_create_option_meta
JedWatson 77b61f3
rollback lockfile
ebonow f4aaf24
Merge branch 'master' into aria-messages-v4
JedWatson 2584428
Merge branch 'master' into remove-browser-alias-fields
JedWatson ddf1043
Merge branch 'master' into clean-common-props
JedWatson f9b2015
Merge pull request #4414 from ebonow/aria-messages-v4
JedWatson 838bd69
Fixed formatting
JedWatson 77529b5
Merge branch 'master' into memoize-strip-diacritics-for-input
JedWatson 1e73e5c
Merge pull request #3827 from JedWatson/memoize-strip-diacritics-for-…
JedWatson 8543862
Merge branch 'master' into tab-index-as-number-type
JedWatson fb12db2
Merge pull request #4443 from JedWatson/tab-index-as-number-type
JedWatson fbd5ace
Merge branch 'master' into remove-browser-alias-fields
Methuselah96 e9781b4
Merge branch 'master' into clean-common-props
Methuselah96 46f7022
Merge branch 'master' into add_missing_create_option_meta
Methuselah96 37264a1
Merge pull request #3875 from andreme/add_missing_create_option_meta
JedWatson b8f9ec7
Merge branch 'master' into remove-browser-alias-fields
Methuselah96 52a27c5
Merge branch 'master' into clean-common-props
Methuselah96 1978819
Merge pull request #4423 from Methuselah96/remove-browser-alias-fields
JedWatson 665f7ae
Merge branch 'master' into clean-common-props
Methuselah96 55b1432
Merge pull request #4391 from JedWatson/clean-common-props
JedWatson 4afd78a
Version Packages
github-actions[bot] ef2090e
Merge pull request #4449 from JedWatson/changeset-release/master
ebonow ce1e3ad
Merge branch 'master' into patch-1
JedWatson cf170ca
Merge pull request #4445 from hazem3500/patch-1
JedWatson ed8b85f
Ensure window exists in passive events pollyfill
ebonow ca3c41b
Adding changeset
ebonow c630e24
Merge branch 'master' into check-window-exists-in-passive-events-poll…
ebonow fd9fa23
Merge pull request #4478 from JedWatson/check-window-exists-in-passiv…
ebonow 3ae57af
Version Packages
github-actions[bot] 56be61b
Merge pull request #4479 from JedWatson/changeset-release/master
ebonow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -742,14 +742,15 @@ export default class Select extends Component<Props, State> { | |||||
}; | ||||||
} | ||||||
|
||||||
getValue = () => this.state.selectValue; | ||||||
|
||||||
cx = (...args: any) => classNames(this.props.classNamePrefix, ...args); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or better yet:
Suggested change
|
||||||
|
||||||
getCommonProps() { | ||||||
const { clearValue, getStyles, setValue, selectOption, props } = this; | ||||||
const { classNamePrefix, isMulti, isRtl, options } = props; | ||||||
const { selectValue } = this.state; | ||||||
const { clearValue, cx, getStyles, getValue, setValue, selectOption, props } = this; | ||||||
const { isMulti, isRtl, options } = props; | ||||||
const hasValue = this.hasValue(); | ||||||
const getValue = () => selectValue; | ||||||
|
||||||
const cx = classNames.bind(null, classNamePrefix); | ||||||
return { | ||||||
cx, | ||||||
clearValue, | ||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.