frontend-collective / frontend-collective/react-sortable-tree

Component does not always re-render when changing theme

Open
#505 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5k
Forks
914
PR merge metrics
No merged PRs in 30d

Description

# Reporting a Bug?

I have an application where I would like to dynamically change the theme of my react-sortable-tree control between the default theme and the FileExplorerTheme.

I can't find any document way to explicitly set the default theme, so I am currently using:

const DEFAULT_THEME = {
rowHeight: 50,
scaffoldBlockPxWidth: 32,
nodeContentRenderer: undefined,
placeholderRenderer: undefined,
treeNodeRenderer: undefined
};

When I set the theme property for FileExplorerTheme the tree re-renders in the new theme. However when I set it back to DEFAULT_THEME the new row height and scaffold block width properties seem to take effect but other visual aspects (which I assume are under control of the renderer callbacks) do no not reset.

Does anyone know how to make this work?

Thanks
Jon.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.