Open sceutre opened 7 years ago
Looks like it might be related to props.children bring an empty array. Does this happen outside the demo when not extending a shared class?
Yes, this more minimal example displays the same behavior:
import * as React from "react";
import {Tree} from "@blueprintjs/core";
export class JSONPreview extends React.Component<{},{}> {
render() {
let contents:any = [ { id: 1, label: "A folder" } ];
return (
<div>
{"{"}
<Tree contents={contents} />
{"}"}
</div>
);
}
}
I think this might be fixed as of preact 7.1?
I had a similar issue in my application and can confirm that 7.1 can render it for the first time.
@ruiaraujo nice! anything else with Blueprint having issues? If not we can close this issue out 🎉
@developit Just to be clear. I was not using blueprint. I just had an infinite loop that did get resolved with 7.1.
Since I tried every release from 6.x. I have some confident that 7.1 made a difference.
Ahh sorry, that makes sense. Here's hoping the issue was similar and they are both fixed :)
Unfortunately I still see the same behavior with the example code above using preact@7.1.0 and preact-compat@3.9.4
Alright, thanks for testing @sceutre!
Any update?
Nope! There have been a whole bunch of releases since the last comment though, it's very possible this is no longer an issue.
Is this still a problem with preact x? I am considering the switch to preact for one of my app.
I am using preact with webpack and the following aliases: { 'react': 'preact-compat', 'react-dom': 'preact-compat', 'react-addons-css-transition-group': 'rc-css-transition-group' }
Which seems to work fine.
We are evaluating the new blueprintjs react library (1) and I was attempting to add a tree component. When I use their example code (2) then it works fine in react itself, but goes into an infinte loop when using preact.
(1): http://blueprintjs.com/ (2): https://github.com/palantir/blueprint/blob/master/packages/core/examples/treeExample.tsx