create-react-apps supports absolute imports via .env
.env
NODE_PATH=src
this will make webpack look for absolute imports (imports without .. or /) in the src directory of our project, meaning we can do something like this
| /* actions fired when listing/adding/editing posts or pages */ | |
| /* admin_head-(hookname) */ | |
| add_action( 'admin_head-post.php', 'admin_head_post_editing' ); | |
| add_action( 'admin_head-post-new.php', 'admin_head_post_new' ); | |
| add_action( 'admin_head-edit.php', 'admin_head_post_listing' ); | |
| function admin_head_post_editing() { | |
| echo 'you are editing a post'; | |
| } |