-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use dedicated file for React functions
- Loading branch information
Showing
3 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
namespace Feliz.ViewEngine | ||
|
||
open System | ||
|
||
//fsharplint:disable | ||
|
||
type React = | ||
/// <summary> | ||
/// Creates a React function component from a function that accepts a "props" object and renders a result. | ||
/// A component key can be provided in the props object, or a custom `withKey` function can be provided. | ||
/// </summary> | ||
/// <param name='render'>A render function that returns an element.</param> | ||
/// <param name='withKey'>A function to derive a component key from the props.</param> | ||
static member functionComponent(render: 'props -> ReactElement, ?withKey: 'props -> string) = | ||
render | ||
|
||
/// <summary> | ||
/// Creates a React function component from a function that accepts a "props" object and renders a result. | ||
/// A component key can be provided in the props object, or a custom `withKey` function can be provided. | ||
/// </summary> | ||
/// <param name='name'>The component name to display in the React dev tools.</param> | ||
/// <param name='render'>A render function that returns an element.</param> | ||
/// <param name='withKey'>A function to derive a component key from the props.</param> | ||
static member functionComponent(name: string, render: 'props -> ReactElement, ?withKey: 'props -> string) = | ||
render | ||
|
||
/// <summary> | ||
/// Creates a React function component from a function that accepts a "props" object and renders a result. | ||
/// A component key can be provided in the props object, or a custom `withKey` function can be provided. | ||
/// </summary> | ||
/// <param name='render'>A render function that returns a list of elements.</param> | ||
/// <param name='withKey'>A function to derive a component key from the props.</param> | ||
static member functionComponent(render: 'props -> #seq<ReactElement>, ?withKey: 'props -> string) = | ||
render | ||
|
||
/// <summary> | ||
/// Creates a React function component from a function that accepts a "props" object and renders a result. | ||
/// A component key can be provided in the props object, or a custom `withKey` function can be provided. | ||
/// </summary> | ||
/// <param name='render'>A render function that returns a list of elements.</param> | ||
/// <param name='name'>The component name to display in the React dev tools.</param> | ||
/// <param name='withKey'>A function to derive a component key from the props.</param> | ||
static member functionComponent(name: string, render: 'props -> #seq<ReactElement>, ?withKey: 'props -> string) = | ||
render |