Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Lazily initialize state
  • Loading branch information
stacimc committed Sep 7, 2021
commit 187e38315903d2a7e724ab9441ed66c9941f2733
11 changes: 6 additions & 5 deletions packages/block-editor/src/hooks/border-color.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ export function BorderColorEdit( props ) {
const disableCustomColors = ! useSetting( 'color.custom' );
const disableCustomGradients = ! useSetting( 'color.customGradient' );
const [ colorValue, setColorValue ] = useState(
getColorObjectByAttributeValues(
colors,
borderColor,
style?.border?.color
)?.color
() =>
getColorObjectByAttributeValues(
colors,
borderColor,
style?.border?.color
)?.color
);

const onChangeColor = ( value ) => {
Expand Down