jayphelps / jayphelps/react-observable-subscribe
React 16+ changes
- Dominant language
- JavaScript
- Stars
- 134
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
React 16.0 relaxed `render()` return types to anything renderable (which `prop-types` and `@types/react` call a "node"), so you should return the observer output as-is, and not wrap in `` (which can break layouts). See https://reactjs.org/blog/2017/09/26/react-v16.0.html
React 16.3 has deprecated `componentWill*` methods (except for `componentWillUnmount`), and will warn if they are used. See https://reactjs.org/blog/2018/03/29/react-v-16-3.html. In my version of this, I simply used the `Did` versions instead, which seems to be mostly fine, but in the new async rendering mode, these might run some time after render, which could be a problem for synchronous observable outputs. Further, `WillUpdate` may run multiple times before an update, though it's not actually described why. The `create-subscription` package the react blog [mentions here](https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#adding-event-listeners-or-subscriptions) might be a relevant reference (perhaps this library would work as a wrapper on it?)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the linked React 16.0 and 16.3 announcements, then inspect the component implementation and its observer-output and lifecycle handling. The issue names no files or tests; done would require a decided approach for renderable outputs and deprecated lifecycle methods, including behavior under asynchronous rendering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100