In React, the class of a custom component needs to be obtained through the attribute className and manually set to the dom element. For example the following code:
@dasmikko
Regarding the 'div' element of all: unset, this is because the react component is used in the vue component, and the vue label is continued to be used in the children of the react component. During the conversion process, a container must be added.
I'm trying to set the class of a React component, but can't get it to work.
I've also tried using className prop, but doesn't work either.
In the example, i'm trying to add the class "i-should-be-a-class" to the QuickPinchZoom react component, but the class never appears.
I can also see that this tag:
In React, the class of a custom component needs to be obtained through the attribute className and manually set to the dom element. For example the following code:
Test.vue
ASimpleReactComponent
@dasmikko Regarding the 'div' element of
all: unset
, this is because the react component is used in the vue component, and the vue label is continued to be used in the children of the react component. During the conversion process, a container must be added.I see, but thanks, making a sub react component did the trick!
@dasmikko I have been trying to solve the problem of removing this container, but until now I have no idea.
@dasmikko
Try
applyPureReactInVue
! https://github.com/devilwjp/veaury/blob/master/pure_mode.md