1
也許這是違反反應的哲學,但我想知道是否有可能確定剛剛安裝的組件的類。安裝時從React組件獲取html類名稱
例如:要實現這一目標
export class HelloWorldDiv extends Component {
componentDidMount() {
// can I magically determine that the class of the component that just mounted (in this case 'hello-world')?
// totally open to using jquery if necessary
}
render() {
return (
<div className="hello-world">
</div>
)
}
}