Skip to content

Instantly share code, notes, and snippets.

@codearryaas
Created August 7, 2020 16:35
Show Gist options
  • Save codearryaas/8b5d78642635e86ae895feca72c1c350 to your computer and use it in GitHub Desktop.
Save codearryaas/8b5d78642635e86ae895feca72c1c350 to your computer and use it in GitHub Desktop.
Start Point for react.
import { render } from '@wordpress/element'
import domReady from '@wordpress/dom-ready';
const App = () => {
return <>Welcome to WP react Tuts</>
}
domReady(function () {
if ('undefined' !== typeof document.getElementById('wp-react-plugin-test-app') && null !== document.getElementById('wp-react-plugin-test-app')) {
render(<App />, document.getElementById('wp-react-plugin-test-app'));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment