How to get script inside ***dangerouslySetInnerHTML*** get executed?

```
class Page extends Component {

  render() {
    return (
      <script
        dangerouslySetInnerHTML={{ __html: `
          console.log('hello world');
          window.dataLayer = window.dataLayer || [];
          window.dataLayer.push({
            event: 'viewCart'
          });
        ` }}
      />
    );
  }
}

```

I can't get `console.log('hello world')` executed. Anybody can help? Thank you