Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes two unrelated issues that have been introduced on this commit: cf41aed
The
SmartItemBasicView
was using auseMemo
that was not being called on every render, due to an early return if the entity had no Config component. Hooks need to be called allways on every render to work properly, so this was causing runtime errors. I refactored it to instead of usinguseHasComponent
to return early, it just checks for a null config.The
useHasComponent
hook would cache values when switching between different entities. I added an effect to refresh the value if the entity changes. This caused the issue where switching from a smart item to a regular item, it would keep the 'Enable Advanced Mode' option on the dropdown even though the currently selected entity was not a smart item (same for the other way around, going from a non-smart entity to a smart one would cache the value and would not show the 'Enable Advanced Mode' option).