react-planet | react lib for building circular menus | Menu library
kandi X-RAY | react-planet Summary
kandi X-RAY | react-planet Summary
A react lib for building circular menus in a very easy and handy way.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of react-planet
react-planet Key Features
react-planet Examples and Code Snippets
Community Discussions
Trending Discussions on react-planet
QUESTION
I added the (from react-planet) to my App and the placement of some
(from the Material UI) components changed.
While looking inside "Elements" in DevTool I noticed that divs inside the component have two classes
jss3
and jss{i}
where i
is the next integral number. Each has different properties inside which overwrites every component in App that is using one of the jss{i}
classes.
I also noticed that at first render i
iteration, which applies to jss{i}
used in newly created divs, starts from 1 and ends at 9 - because I have 6 planets so 1 for the main div, 2 for the central planet, 3 for divs' first class, and 4-9 for the six divs' second class. After the second render number goes from 10 to 18.
Screenshots of Elements at first render and second.
The class ={jss3 jss4}
example
The class ={jss3 jss5}
example
I assume that after creating planets by , whose children have two classes, the newly created class
jss{i}
, based on makeStyles-root-{i}
, is overwriting properties of jss{i}
, which is used somewhere else on page by components thus changing placement for the whole page.
Code where component is used:
ANSWER
Answered 2021-Sep-27 at 00:46I am not sure what was exactly the cause of the "multiply class in one component" bug, but I copied Planet.tsx and Orbit.tsx from the react-planet repository and changed some code, get rid of makeStyles and problem solved. It was probably of nested makeStyles in all of those components in react-planet which conflicted with each other at different component rendering levels causing it to render multiple times in one object.
Additionally, it was overriding Material UI components styles due to simplified class naming from MUI makeStyle to css class while building production (makeStyles-root-{i} -> jss{i}, makeStyles -> jss).
Overriding styles were probably caused by the react-planets dependency of the old/different MUI version than I have for the rest of the code which created two styles generators for each of those versions as mentioned in MUI FAQ. The first generator created class from makeStyle for all of my page naming every class jss{i++} for i starting at i=1 and ending when all classes are renamed, then the react-planet generator created styles for its objects naming every class jss{i++} starting from i=1 leading to overriding every previous class=jss{i} with new properties.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install react-planet
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page