You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this ref that I'm trying to make into an Observable with RxJS:
const input = useRef();
const observableTry = fromEvent( input.current, //this input already have a handle that sets the new state 'change', ).pipe(tap(console.log));
Then simply I'm trying to subscribe to it: useEffect(() => { observableTry.subscribe() })
After a 'fast refresh' it usually works. After a reload it start giving errors.
After an error, a 'fast refresh' keeps on giving errors and I have to do a reload again.
Not able to reproduce anymore, but a while ago the reload wasn't only giving errors, but "breaking" (stopping) the whole "next dev" script. I'm already use a "predev" script that rimraf the '.next' folder since I've had a few problems with persisting errors before.
My structure until now is basically the "create next app" and from the index page I call my "app" component that have a "input component" that have this logic.
To Reproduce
Create a observable from a reference (ex: useRef) and try to subscribe to it.
Expected behavior
In this case, any change to the value of the input should be logged to the console.
Screenshots
System information
OS: Windows 10
Version of Next.js: 9.5.5
Version of Node.js: 12.19.0
Additional context
I believe this to be some weird side effect related to Next compiler with RxJS and not from React/RxJS alone.
This discussion was converted from issue #18270 on October 28, 2020 13:51.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Bug report
Describe the bug
I have this ref that I'm trying to make into an Observable with RxJS:
const input = useRef();
const observableTry = fromEvent(
input.current, //this input already have a handle that sets the new state
'change',
).pipe(tap(console.log));
Then simply I'm trying to subscribe to it:
useEffect(() => { observableTry.subscribe() })
After a 'fast refresh' it usually works. After a reload it start giving errors.
After an error, a 'fast refresh' keeps on giving errors and I have to do a reload again.
Not able to reproduce anymore, but a while ago the reload wasn't only giving errors, but "breaking" (stopping) the whole "next dev" script. I'm already use a "predev" script that rimraf the '.next' folder since I've had a few problems with persisting errors before.
My structure until now is basically the "create next app" and from the index page I call my "app" component that have a "input component" that have this logic.
To Reproduce
Create a observable from a reference (ex: useRef) and try to subscribe to it.
Expected behavior
In this case, any change to the value of the input should be logged to the console.
Screenshots
System information
Additional context
I believe this to be some weird side effect related to Next compiler with RxJS and not from React/RxJS alone.
Beta Was this translation helpful? Give feedback.
All reactions