Skip to content
  • 619-209 467 8400
  • 2096 Dennison Street, Stockton, CA – 95202
Main Demo
  • Categories 
    • Marketing 
      • All Marketing
      • Amazon FBA
      • Instagram Marketing
      • Digital Marketing
      • Google Analytics
      • Project Management
      • Product Manager
    • Development 
      • All Development
      • JavaScript
      • Angular 8
    • IT & Software 
      • All IT & Software
      • Cyber Security
      • AWS
      • Web Developer
      • Copywriting
    • Business
    • Design 
      • All Design
      • Graphic Design
      • Character Art
      • Adobe XD
      • Filmmaker Guide
    • Photography 
      • All Photography
      • Architecture Photography
      • Cinematography
Search for:
  • Home
  • Courses
  • Pages 
    • About Us
    • Become a Teacher
    • Careers
    • Help Center
    • FAQ
  • Blog 
    • Blog List
    • Blog Grid
  • Contact
Main Demo
Menu Close
  • Home
  • Courses
  • Pages 
    • About Us
    • Become a Teacher
    • Careers
    • Help Center
    • FAQ
  • Blog 
    • Blog List
    • Blog Grid
  • Contact

© Tophive 2020

  • Home
  • Blog
  • Five ways online learning can help your career path

Login

Lost your password?

Not Registered? Sign up

Sign Up

  • The password should be at least twelve characters long. To make it stronger, use upper and lower case letters, numbers, and symbols like ! " ? $ % ^ & )

Already registered? Signin

Five ways online learning can help your career path

Tophive TeamTophive Team- April 26, 2020- Education- 0 Comments

FunctionComponent

In this article, we’ll talk about typing Next.JS components. We’ll be using this Next.JS application that connects to Reddit API and displays a list of top posts in a given subreddit. Right now, the main component Posts.tsx doesn’t have any type-safety, so we’re going to fix that.

Note: the project already contains TypeScript configured, so if you don’t know how to do that, please read the official guide here, it’s as easy as installing a few dependencies and dropping in some configuration files.

If we write our components as functions, we can use FunctionComponent type from React library. This type takes a generic type argument that describes the shape of the props. Our Posts component takes a subreddit name and a list of posts, so props object is going to look like this:

One thing that makes Next.JS components different is a static getInitialProps function. If we try to assign it to our regular React component, we’ll get a type error: To fix this problem, we need to use a special component type from Next.JS package called NextFunctionComponent. This type extends standard React’s FunctionComponent type with Next.JS-specific static lifecycle methods (well, only one method, really). So now our code will look like this:

Do you have any tips for students?
  • Having contacts is the key , you have to develop your network, be friendly and polite;
  • Be authentic : we never know who we can fall, sometimes affinities are created and we eventually find ourselves working with the person. My graphics jobs were obtained through contacts who were already working internally. Do
    not minimize the development of your contacts during your studies.
  • Be 100% yourself! As much in your designs as in your portfolio, or during interviews. Most employers hire you if they feel that you will bring a good attitude and good energy to the team.
  • Everything can be learned! Indesign (the layout software) was my weak point, and yet, I was engaged in editing! Do not be afraid to apply to places outside of your comfort zone , if the employer hires you, it is because he knew how to see your potential and he will take the time to teach you.
  • True fact : The most pleasant jobs are not the ones that pay the most (even if publishing is a dream for many, unfortunately the salary is not as good as a job in web or animation that will bring more ).
  • Enjoy ! I am still young (25 years old), so I take the opportunity to try different things and aspects of the job! Do the same!

I participate in beautiful projects that are close to my values. I am extremely grateful to be in such a great team!

© Black and white portrait photo credits: Lola Meunier

Future Learning, Learning
Share this post
Tophive Team
About The Author

Tophive is an agency with top talented designers and developers crowd. Our team of 7 includes UI and UX designers, Front-end, and back-end developers. The team has extensive experience in building high-quality websites for MNC as well as agencies from the local and global territory.

View all post by Tophive Team | Website

Post navigation

Previous Previous post: prev-post4 simple ways to improve data literacy across
Next Next post: next-postWhat does the future of learning look like?

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Solutions

  • Google Analytics Certification
  • Digital Marketing Masterclass
  • CompTIA Network
  • Character Drawing
  • Network Engineers
  • Web developer Bootcamp
  • AWS Certified Solutions
  • Communication Skills

Learning

  • Business
  • Development
  • IT & Software
  • Marketing
  • Design
  • Photography

About

  • Our Story
  • Resource Center
  • MasterClass for Business
  • Get The App

© 2022 Main Demo – Powered by masterclass.