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

chore(examples, tests): remove React.FC from the TSX file #603

Merged
merged 1 commit into from Jul 19, 2021

Conversation

liby
Copy link
Contributor

@liby liby commented Jul 19, 2021

We would be removing FC, so I'd just leave it for now.

It's done.

@vercel
Copy link

vercel bot commented Jul 19, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pmndrs/jotai/82uWhK8A2z65PeeAmTwMhVrL5CmH
✅ Preview: https://jotai-git-fork-liby-master-pmndrs.vercel.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 19, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit a0b9f08:

Sandbox Source
React Configuration
React Typescript Configuration

Copy link
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

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

Thanks again for you work.

Although this might be controversial if we ask someone, but let's assume it's the trend/recommendation and merge this.

@dai-shi dai-shi merged commit 2c3e3c3 into pmndrs:master Jul 19, 2021
@liby
Copy link
Contributor Author

liby commented Jul 19, 2021

Although this might be controversial if we ask someone, but let's assume it's the trend/recommendation and merge this.

Thank you for your indulgence. I’ll continue to follow up on the issue of adding only one line between absolute path import and relative path import.

@dai-shi
Copy link
Member

dai-shi commented Jul 19, 2021

@liby Would you mind if I ask another chore? For consistency, we'd want to use import type {} for TS types in src and tests, (maybe not in examples).

@liby
Copy link
Contributor Author

liby commented Jul 19, 2021

@dai-shi
Happy to help, but it may be a little later. I will first see if there is an easy way to distinguish between type. If there is no good way, I may need to find it one by one in the clumsiest way.

@liby
Copy link
Contributor Author

liby commented Jul 19, 2021

@dai-shi Hi, I have a question that has been bothering me for a long time and I don't have any clue, so I would like to seek help from you.

The use of Add all missing imports in the .tsx file in the "tests" folder will always import React, See below:

Kapture 2021-07-20 at 00 27 10

Rename the Provider.ts file to Provider.tsx, consistent with the behavior in the gif.


Changing jsx value in the tsconfig.json file to react-jsx solves the above problem:

Kapture 2021-07-20 at 00 31 32


The problem is solved, but I am still confused as to why the behavior is inconsistent when "jsx": "preserve", I checked a lot of related issue, but I couldn't get an answer.(e.g., TypeScript/issues/41958, TypeScript/issues/41762, TypeScript/pull/41950)

You built this project, maybe you can give me an answer? I've been obsessed with it all day. Looking forward to your reply

@dai-shi
Copy link
Member

dai-shi commented Jul 19, 2021

...unfortunately, I don't know. I usually type imports before writing code...
Changing tsconfig is acceptable as long as the final build files are identical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants