typescript and react types
It can be confusing to move from javascript to typescript if you are not used to types. If you want to use more advanced react component creation techniques, it can be even more confusing. Passing Down “Created” Elements If you pass in elements, such as a message to display when there is no data, you need to pass in either a react element or someting you pass to JSX/createElement (see Pass in Elements for Your Component). If you already have an element that you created in the parent element, then you have an element you want to pass. You may just want to pass in something that is renderable. Should you pass in a RectElement or something more general that is renderable? What type should you use? If you think of the element you want to pass like children, then you can find the definition for what is passed is children by looking at some of the other definitoions. You’ll find ReactNode[] . // // React Nodes // http://facebook.github.io/react/docs/glossary.html ...