Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ScrollFollow results in maximum updates exceeded error #36

Closed
kevinvugts opened this issue Jul 8, 2024 · 6 comments
Closed

Using ScrollFollow results in maximum updates exceeded error #36

kevinvugts opened this issue Jul 8, 2024 · 6 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation
Milestone

Comments

@kevinvugts
Copy link

Hi, when using the auto scroll functionality it currently results in an infinite loop.

@melloware
Copy link
Owner

can you put together a StackBlitz example showing the issue?

@melloware melloware added the bug Something isn't working label Jul 8, 2024
@kevinvugts
Copy link
Author

@melloware I figured out that the issue happens when the outer div containing the doesn't have an height, the issue occurs. When you set an height on the outer div, the issue is gone

@melloware
Copy link
Owner

@kevinvugts can you post your sample code that works? I would like to update the README.MD. The current docs

import React from "react";
import { render } from "react-dom";
import { LazyLog, ScrollFollow } from "@melloware/react-logviewer";

render(
    <ScrollFollow
        startFollowing={true}
        render={({ follow, onScroll }) => (
            <LazyLog url="http://example.log" stream follow={follow} onScroll={onScroll} />
        )}
    />,
    document.getElementById("root"),
);

@melloware
Copy link
Owner

@kevinvugts ?

@kevinvugts
Copy link
Author

@kevinvugts ?

GOodmorning melloware,

Just simply wrap the with a div containing a fixed height

<div style={{ height: 500, width: 902 }}>
  <ScrollFollow
    startFollowing
    render={({ onScroll, follow, startFollowing, stopFollowing }) => (
      <LazyLog extraLines={1} enableSearch url={url} stream onScroll={onScroll} follow={follow} />
    )}
  />
</div>```

@melloware
Copy link
Owner

@melloware melloware added the documentation Improvements or additions to documentation label Jul 12, 2024
@melloware melloware added this to the 5.1.1 milestone Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants