-
Notifications
You must be signed in to change notification settings - Fork 13
Move lightweight components to React functional components #76
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very nice!
}; | ||
// This blocks render indefinitely if the driver is never resolved. | ||
// A better pattern would be to render anyway without driver, | ||
// only calling getDriver() when a module wants to use the driver. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem here is that the Layer component needs data from the graph to render (to get the list of labels or whether neo4j-spatial is available).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this true when we load data from file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we start off with a blank layer that doesn't render on the map, driver comes into play when we create new / update layer. IMO that's when we need to check for the driver, and first layer to check for driver should create an instance usable by any other subsequent ones.
We still get side pane and empty map experience even if we didn't have a driver. At create in case we cant boot up a driver, could we possibly provide a flow for troubleshooting/manually establishing a graph connection within neo4j desktop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, this does not apply when we load data from file.
But it does appear before the layer create/update, since we not only get data for the map, but also data to configure the layer. In terms of UX, it is important to keep this flow. I suggest that we move this discussion to a new issue though, it is not directly related to this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For tracking, discussion about this topic moved to:
#78
@stellasia, I resolved merge conflict in pr. You can review again |
Everything except Map and Layer, refactored as react functional components with hooks.