kriasoft / kriasoft/react-firebase-starter
Unnecessary buggy calls to MDL upgrade-/downgradeElements
- Dominant language
- JavaScript
- Stars
- 4.5k
- Forks
- 752
- PR merge metrics
- No merged PRs in 30d
Description
These lines are present in several components originally present in the archive:
```
componentDidMount() {
window.componentHandler.upgradeElement(this.root);
}
componentWillUnmount() {
window.componentHandler.downgradeElements(this.root);
}
```
But "index.ejs" mentions that it is importing `react-mdl`:
```
```
which [does not require to call these manually](https://github.com/tleunen/react-mdl/issues/361#issuecomment-238843220). Moreover, it can hide errors happening in componentDidMount in child components, as pointed here: https://github.com/tleunen/react-mdl/issues/361.
I could remove the aforementioned lines without anything breaking in my app. Is this code present here on purpose, or should it be removed ?
Edit: These lines are useful only if you try to use MDL components without react-mdl or material-ui (which you probably shouldn't anyway).
Contributor guide
No contributing guide indexed for this repository
Research direction
Search the repository for componentDidMount/componentWillUnmount calls to componentHandler.upgradeElement and downgradeElements, then inspect index.ejs and the affected components. Confirm whether react-mdl already handles these calls and verify that removing them does not break the affected components or hide child component errors; done means the unnecessary calls are removed consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100