App Componenet Example in Next.js + React Tutorial Outdated

Highlighted
Shopify Partner
105 4 43

Not sure where the proper forum for doc improvements is, so I'll just put this here (since https://github.com/Shopify/shopify-demo-app-node-react/issues seems to be more towards tech issues, and I'm not sure the repo accepts PRs).

 

Going over https://developers.shopify.com/tutorials/build-a-shopify-app-with-node-and-react/build-your-user-int..., it seems you're using the longhand form of a React fragment. Since you're urging folks to use latest node and latest React, I'd refactor with the new format:

 

import App from 'next/app';
import Head from 'next/head';

class MyApp extends App {
  render() {
    const { Component, pageProps } = this.props;
    return (
      <>
        <Head>
          <title>Sample App</title>
          <meta charSet="utf-8" />
        </Head>
          <Component {...pageProps} />
      </>
    );
  }
}

export default MyApp;
Building custom, public-facing Shopify Apps for various niches. Ping me with your app ideas!

My Apps:
* Countries We Ship To Button (Free!) - Show your customers where you ship to with a crisp button + pop-up!


My Tutorials:
* Get Notified When New Comments Are Added To Your Shopify Blog (Free!) - A quick & easy tutorial to set up a free web-service that e-mails you when you get a new comment on your Shopify blog!
0 Likes