question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The goal is to convert most of our components to React Hooks for simplicity. Not all components need to be converted to React Hooks, only those where it makes sense (Stateless, simple state/lifecycle needs). For all Pull Requests, make sure:

  • no tests are removed. We want to maintain coverage. Keep in mind, our testing library Enzyme has some notable issues with React Hooks. Check their issue to see if your changes fall into this bucket.
  • coverage for the component is well-handled. It’s not worth refactoring if the component has good coverage originally.

Here’s a tracker for all of the components grouped by their folder.

core

  • Block - Not worth changing
  • Countdown - Uses State
  • MainMenu - Uses State
  • MainMenu / ScreencastOption
  • Maybe - Uses shouldComponentUpdate
  • ReportView - https://github.com/streamlit/streamlit/pull/1823
  • Sidebar - Uses State
  • StatusWidget - Uses State
  • StreamlitDialog - Complex and uses state in some cases

elements

shared

widgets

  • Button - https://github.com/streamlit/streamlit/pull/1817
  • Checkbox - Uses State
  • ColorPicker - Uses State
  • CustomComponent - Uses State
  • DateInput - Uses State
  • FileUploader - Postponed
  • MultiSelect - Uses State
  • NumberInput - Uses State
  • Radio - Uses State
  • Selectbox - Uses State
  • Slider - Uses State
  • TextArea - Uses State
  • TextInput - Uses State
  • TimeInput - Uses State

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
randyzwitchcommented, Jul 15, 2020

Hi @tanmaylaud -

We don’t have a public Gitter channel or anything where these things are discussed; to be honest, we haven’t had anyone who wanted to contribute to such a large piece of the project before 😃

Can you send me an email so that I can further understand your background and your interests?

2reactions
kmcgradycommented, Aug 13, 2020

All components with the above criteria have been converted to React Hooks. If any other components get refactored, the developer has the option to convert to a React Hook if they like.

Closing this issue. Thanks again to @tanmaylaud for helping get this to the finish line!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introducing Hooks - React
Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class. ... This...
Read more >
Using the State Hook - React
Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class. ... We'll...
Read more >
Rules of Hooks - React
Don't call Hooks inside loops, conditions, or nested functions. Instead, always use Hooks at the top level of your React function, before any...
Read more >
useHooks - Easy to understand React Hook recipes
Hooks are a feature in React that allow you use state and other React features without writing classes. This website provides easy to...
Read more >
streamich/react-use: React Hooks - GitHub
React Hooks — . Contribute to streamich/react-use development by creating an account on GitHub.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found