chromaui / learnstorybook-code

Code for Learn Storybook
https://learnstorybook.com
MIT License
396 stars 1.21k forks source link

Problems used in typescript #66

Closed DanaCoding closed 2 years ago

DanaCoding commented 2 years ago

I have a question. When using interface in a component, the data type can be defined very well. In my practice, it really performs well in the storybook. but! , When I switch to the app itself, I even only see a blank page. How can I make the component itself be able to use this type to render in the browser? Should I comment it out? Assign value again?

Short example component.tsx

interface props {
  value: string
}
export default function({value}:props){
   retutn(
      <div>{value}<div>
   )
}
jonniebigodes commented 2 years ago

@DanaCoding can you elaborate a bit on this issue and provide some more detailed examples so that we can follow up with you on this?

Have a great day.

Stay safe

DanaCoding commented 2 years ago

I think I have figured out the problem clearly, that is, using the CDD development model, and finally rendering the data only at the page level.

jonniebigodes commented 2 years ago

@DanaCoding let me know how it turned out and should you face any issues let me know and we can re-open the issue, or join our Discord server and post the question there, our community is really helpful and will probably be able to give you some guidance.

Have a great weekend!

Stay safe