Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(v2): make proper path to pages in TS #2334

Merged
merged 1 commit into from
Feb 27, 2020
Merged

Conversation

lex111
Copy link
Contributor

@lex111 lex111 commented Feb 26, 2020

Motivation

This was not a quick way to add support for pages in TypeScript - one, two, and finally this third (and last) attempt for this! Now officially D2 supports the creation of pages in TS, woohoo!

Corresponding request on Canny - https://docusaurus.canny.io/admin/board/feature-requests/p/typescript-pages

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

  1. Create a page in TS (eg page.tsx) with any valid contents, for example:
import React, {useEffect} from 'react';
import Layout from '@theme/Layout';

function Page() {
  let name: string = 'TypeScript';

  return (
    <Layout>
      <div className="container margin-vert--xl">
        <h1>Hello {name}!</h1>;
      </div>
    </Layout>
  );
}

export default Page;
  1. Start D2 and check it out new page by navigating on /page

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@lex111 lex111 added the pr: bug fix This PR fixes a bug in a past release. label Feb 26, 2020
@lex111 lex111 added this to the v2.0.0-alpha.44 milestone Feb 26, 2020
@lex111 lex111 requested a review from yangshun February 26, 2020 22:54
@lex111 lex111 requested a review from wgao19 as a code owner February 26, 2020 22:54
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Feb 26, 2020
@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-2 ready!

Built with commit 003b7e3

https://deploy-preview-2334--docusaurus-2.netlify.com

Copy link
Contributor

@yangshun yangshun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha finally! Thanks Alexey!

@yangshun yangshun merged commit 68a5cd5 into master Feb 27, 2020
@yangshun yangshun deleted the lex111/typescript-pages branch February 27, 2020 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants