File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -909,9 +909,22 @@ type PropsEqualityComparison<'props> = 'props -> 'props -> bool
909909/// component, and reuse the last rendered result.
910910///
911911/// By default it will only shallowly compare complex objects in the props object. If you want control over the
912- /// comparison, you can also provide a custom comparison function as the second argument .
912+ /// comparison, you can use `memoWith` .
913913[<Import("memo", from="react")>]
914- let memo<'props> (render: 'props -> ReactElement, areEqual: PropsEqualityComparison<'props> option) : ReactComponentType<'props> =
914+ let memo<'props> (render: 'props -> ReactElement) : ReactComponentType<'props> =
915+ jsNative
916+
917+ /// React.memo is a higher order component. It’s similar to React.PureComponent but for function components instead of
918+ /// classes.
919+ ///
920+ /// If your function component renders the same result given the same props, you can wrap it in a call to React.memo
921+ /// for a performance boost in some cases by memoizing the result. This means that React will skip rendering the
922+ /// component, and reuse the last rendered result.
923+ ///
924+ /// This version allow you to control the comparison used instead of the default shallow one by provide a custom
925+ /// comparison function as the second argument.
926+ [<Import("memo", from="react")>]
927+ let memoWith<'props> (render: 'props -> ReactElement, areEqual: PropsEqualityComparison<'props>) : ReactComponentType<'props> =
915928 jsNative
916929
917930/// Create a ReactElement to be rendered from an element type, props and children
You can’t perform that action at this time.
0 commit comments