Skip to content

Conversation

@labdala
Copy link
Collaborator

@labdala labdala commented Jul 6, 2022

Co-authored-by: Matt McCormick matt.mccormick@kitware.com
Co-authored-by: Paul Elliott paul.elliott@kitware.com

@labdala labdala requested a review from PaulHax July 6, 2022 19:13
const currentRangeMin = currentRange[0]
const currentRangeMax = currentRange[1]

const [step] = useState((currentRange[1] - currentRange[0]) / 200)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

step is derived from other reactive variables so we can just compute step as a plain variable. No need for useState. We can also put the "isFloat" check here, so step becomes 1 for integer data, simplifying our JSX and avoiding logic repetition.

@labdala
Copy link
Collaborator Author

labdala commented Jul 7, 2022

Thank you @PaulHax !

@thewtex
Copy link
Member

thewtex commented Jul 7, 2022

🔢

@thewtex thewtex merged commit 905e27b into main Jul 7, 2022
@thewtex thewtex deleted the color-range-input branch July 7, 2022 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants