1class Test extends Component {
2 constructor(props){
3 //codes
4 }
5
6 hide = () => {
7 const span = this.refs.spanLoading;
8 span.ClassName = "hidden";
9 }
10
11 render() {
12
13 return (
14 <span ref="spanLoading" id="test-id" className="">The Quick Brown Fox.</span>
15
16 <button onClick={() => this.hide()}>Hide</button>
17 );
18 }
19}
20
21export default Test;
22