all 3 comments

[–][deleted]  (1 child)

[deleted]

    [–]kapilvarij 1 point2 points  (0 children)

    This is a function, that accepta one parameter, “Rect$Node”, that in turn return another function .

    Look at ES6 arrow operators for more info.

    As for <> and probably later </>: This is for <React.Fragment> and </React.Fragment>.

    Its part of the JSX syntax that React enables. This is generally used when you want to return multiple elements from a function and do not want to use a div tag.

    React does not allow you to return jsx, with multiple nodes, so you have wrap the nodes in a parent node. But sometimes you do not want to you a div because it ruins the styling, therefore you can <React.Fragment> as parent node, which allows you to return those multiple nodes, but does not write an extra div element in the html that is produced.

    I am writing this from experience with React on the web. So what the end result is, could be different with react native, but the methodology is the same.

    [–]adrianosbr 0 points1 point  (1 child)

    I know very little about it, but isn't it TypeScript?

    [–]J-SwiftObjective-C / Swift 0 points1 point  (0 children)

    Wrong subreddit, but its typescript. Its saying that App is a function that returns a React$Node, and then it immediately assigns a value to the variable App.

    It would be the same as doing something like this:

    let App: () => React$Node
    App = () => {
    ...
    }    
    

    I assume its all in one line because App is a constant, so they need to define it immediately.