{"id":5287,"date":"2025-03-06T13:04:55","date_gmt":"2025-03-06T18:04:55","guid":{"rendered":"https:\/\/frontendmasters.com\/blog\/?p=5287"},"modified":"2025-03-06T13:04:56","modified_gmt":"2025-03-06T18:04:56","slug":"creating-a-keyboard-shortcut-hook-in-react","status":"publish","type":"post","link":"https:\/\/frontendmasters.com\/blog\/creating-a-keyboard-shortcut-hook-in-react\/","title":{"rendered":"Creating a Keyboard Shortcut Hook in React"},"content":{"rendered":"\n<p>I enjoyed this very straightforward, well-presented, useful article on <a href=\"https:\/\/www.taniarascia.com\/keyboard-shortcut-hook-react\/\">how to create a keyboard shortcut hook<\/a> in React from Tania Rascia. It&#8217;s part basic implementation, part designing an API pattern that feels right, part dealing with React hook eccentricities, and part dealing with edge cases. In the end, a pretty readable 86 lines of code.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I enjoyed this very straightforward, well-presented, useful article on how to create a keyboard shortcut hook in React from Tania Rascia. It&#8217;s part basic implementation, part designing an API pattern that feels right, part dealing with React hook eccentricities, and part dealing with edge cases. In the end, a pretty readable 86 lines of code.<\/p>\n","protected":false},"author":1,"featured_media":5288,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[29],"tags":[303,302,62],"class_list":["post-5287","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-the-beat","tag-hooks","tag-keyboard-shortcuts","tag-react"],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/03\/5126340e6019450d0.88700354-2048x1536-1.jpg?fit=2048%2C1536&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/5287","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/comments?post=5287"}],"version-history":[{"count":1,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/5287\/revisions"}],"predecessor-version":[{"id":5289,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/5287\/revisions\/5289"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media\/5288"}],"wp:attachment":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media?parent=5287"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/categories?post=5287"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/tags?post=5287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}