Render React Widget in Angular Component

In Angular Wrapper Component Template (which will host the react component), identify the ID of the host div:

Then in component’s TS, do:

import * as ReactDOM from "react-dom";
import * as React from "react";

ngAfterViewChecked() {

initializeReactWidget("react-wrapper");

}

In initializeReactWidget.js, return the react template:

ReactDOM.render(
<ReactWidgetWrapper AHandler={AHandler}
BHandler={BHandler}><WidgetContainer/></ReactWidgetWrapper>,
document.getElementById("react-wrapper")
);

 

Finally, ReactWidgetWrapper.js:

import React, {PropTypes, Component} from 'react';

class ReactWidgetWrapper extends Component {
constructor(props) {
super(props);
}

getChildContext() {
return {

}
}

render() {
return

{this.props.children}


}
}

ReactWidgetWrapper.childContextTypes = {

};

ReactWidgetWrapper.contextTypes = {

};

ReactWidgetWrapper.propTypes = {

};

export default ReactWidgetWrapper;

Turn display off in Windows 10

Though there are multiple ways to do this – https://www.intowindows.com/7-ways-to-turn-off-windows-10-laptop-screen/

Here are the 2 that work the fastest for me-

  • Using the power button
  • Using this utility – https://sourceforge.net/projects/doff/
    • You can create a shortcut for launching it using keyboard, but in my experience, it adds delay. Instead, pin the program to taskbar, drag it to the top, and use “Windows Key and 1” to launch it.