How to use the default function from react

Find comprehensive JavaScript react.default code examples handpicked from public code repositorys.

117
118
119
120
121
122
123
124
125
126
    }));
};
const mode = this.blockDef.mode || "filter";
return (react_1.default.createElement("div", null,
    react_1.default.createElement("h3", null, "Row"),
    react_1.default.createElement(propertyEditors_1.LabeledProperty, { label: "Table" },
        react_1.default.createElement(propertyEditors_1.TableSelect, { schema: props.schema, locale: props.locale, value: this.blockDef.table || null, onChange: handleTableChange })),
    react_1.default.createElement(propertyEditors_1.LabeledProperty, { label: "Name" },
        react_1.default.createElement(propertyEditors_1.PropertyEditor, { obj: this.blockDef, onChange: props.store.replaceBlock, property: "name" }, (value, onChange) => react_1.default.createElement(bootstrap_1.TextInput, { value: value || null, onChange: onChange, placeholder: "Unnamed" }))),
    react_1.default.createElement(propertyEditors_1.LabeledProperty, { label: "Mode", key: "mode" },
fork icon3
star icon4
watch icon3

+ 15 other calls in file

108
109
110
111
112
113
114
115
116
117
        alert("Registration Successful");
    dispatch({ type: actionTypes.CHNAGE_SEM_VALUE, value: "All" });
}
const links = (0, react_2.useMemo)(() => ["MyCourses", "Admin"], []);
return (react_1.default.createElement("div", { className: "flex wrapper" },
    react_1.default.createElement(Header_1.default, { name: "Course Registration", userName: "Sainath", links: links }),
    react_1.default.createElement("div", { className: "flex sem-selector-and-search-bar" },
        react_1.default.createElement(SemSelector_1.default, { semVal: state.semVal, handleSemVal: handleSemVal }),
        react_1.default.createElement(SearchBar_1.default, { input: state.input, handleInputChange: handleInputChange })),
    react_1.default.createElement("div", { className: "courses-table" },
fork icon1
star icon0
watch icon0

+ 9 other calls in file

42
43
44
45
46
47
48
49
50
51
}
const links = (0, react_2.useMemo)(() => ["Registration", "Admin"], []);
return (react_1.default.createElement("div", { className: "flex wrapper " },
    react_1.default.createElement(Header_1.default, { name: "My Courses", userName: "Sainath", links: links }),
    react_1.default.createElement("div", { className: "flex sem-selector-and-search-bar" },
        react_1.default.createElement(SemSelector_1.default, { semVal: semVal.semVal, handleSemVal: handleSemVal }),
        react_1.default.createElement(SearchBar_1.default, { input: input, handleInputChange: handleInputChange })),
    react_1.default.createElement("div", { className: "my-courses" },
        react_1.default.createElement(MyCourses_1.default, { myCourses: mySelectedCourses })),
    react_1.default.createElement("div", { className: "footer" },
fork icon1
star icon0
watch icon0

+ 7 other calls in file

22
23
24
25
26
27
28
29
30
31
  }
  list-style: none;
`;
const Header = ({ name, userName, links }) => {
    return (react_1.default.createElement("nav", { className: "flex header" },
        react_1.default.createElement("div", { className: "header-image" },
            react_1.default.createElement(react_router_dom_1.Link, { to: "/" },
                react_1.default.createElement("img", { src: logo_png_1.default, style: { width: "85px", height: "85px" }, alt: "Logo here" }))),
        react_1.default.createElement("div", { className: "flex header-name " },
            react_1.default.createElement(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faBook }),
fork icon1
star icon0
watch icon0

+ 13 other calls in file

9
10
11
12
13
14
15
  color: var(--text-color);
`;
let Footer = () => {
    return (react_1.default.createElement(FooterSpan, { className: "footer flex" }, "Copyrights \u00A9Duke University"));
};
let MemoFooter = react_1.default.memo(Footer);
exports.default = MemoFooter;
fork icon1
star icon0
watch icon0

29
30
31
32
33
34
35
36
37
38
}
const links = (0, react_2.useMemo)(() => ["MyCourses", "Admin"], []);
return (react_1.default.createElement("div", { className: "flex wrapper" },
    react_1.default.createElement(Header_1.default, { name: "Admin Panel", userName: "Sainath", links: links }),
    react_1.default.createElement("div", { className: "flex add-course-and-courses-table-div" },
        react_1.default.createElement("div", { className: "add-courses-component-div" },
            react_1.default.createElement(AddCourse_1.default, null)),
        react_1.default.createElement("div", { className: "flex table-and-search-bar" },
            react_1.default.createElement("div", { className: "flex table-heading-and-search-bar" },
                react_1.default.createElement("div", { className: "table-heading" },
fork icon1
star icon0
watch icon0

+ 13 other calls in file

24
25
26
27
28
29
30
31
32
 * @param defaultWhenUndefined The default value for the item when it is undefined in `sessionStorage`.
 * @param options Options for the stored item. See the [documentation](https://justinmahar.github.io/react-storage-complete/?path=/story/hooks-usesessionstorage--page#props) for more.
 * @returns The storage state. See the [documentation](https://justinmahar.github.io/react-storage-complete/?path=/story/hooks-usesessionstorage--page#return) for details.
 */
function useSessionStorage(key, defaultWhenUndefined = undefined, options = useBrowserStorage_1.DEFAULT_BROWSER_STORAGE_OPTIONS) {
    const storage = react_1.default.useMemo(() => (typeof sessionStorage !== 'undefined' ? sessionStorage : {}), []);
    return (0, useBrowserStorage_1.useBrowserStorage)(key, defaultWhenUndefined, storage, options);
}
exports.useSessionStorage = useSessionStorage;
fork icon0
star icon3
watch icon2

24
25
26
27
28
29
30
31
32
 * @param defaultWhenUndefined The default value for the item when it is undefined in `localStorage`.
 * @param options Options for the stored item. See the [documentation](https://justinmahar.github.io/react-storage-complete/?path=/story/hooks-uselocalstorage--page#props) for more.
 * @returns The storage state. See the [documentation](https://justinmahar.github.io/react-storage-complete/?path=/story/hooks-uselocalstorage--page#return) for details.
 */
function useLocalStorage(key, defaultWhenUndefined = undefined, options = useBrowserStorage_1.DEFAULT_BROWSER_STORAGE_OPTIONS) {
    const storage = react_1.default.useMemo(() => (typeof localStorage !== 'undefined' ? localStorage : {}), []);
    return (0, useBrowserStorage_1.useBrowserStorage)(key, defaultWhenUndefined, storage, options);
}
exports.useLocalStorage = useLocalStorage;
fork icon0
star icon3
watch icon2

265
266
267
268
269
270
271
272
273
274
        return this.state.parseError;
    }
    return this.state.error;
}
renderView() {
    return react_1.default.createElement(this.getViewClass(), {
        onCreate: this.onViewCreate,
        ctrl: this,
    });
}
fork icon0
star icon1
watch icon3

86
87
88
89
90
91
92
93
94
95
    return value;
}
static createReactComponent(rootElement, type, props = {}, children = null) {
    // console.log('Helper.createReactComponent', rootElement, type);
    let component;
    const reactRootElement = react_1.default.createElement(react_1.default.StrictMode, {}, [
        react_1.default.createElement(type, Object.assign(Object.assign({}, props), { onCreate: (c) => {
                component = c;
            } }), children),
    ]);
fork icon0
star icon1
watch icon3

+ 3 other calls in file

28
29
30
31
32
33
34
35
36
37
38
39
  throw new Error(`It appears like Gatsby is misconfigured. JSONStore is Gatsby internal ` + `development-only component and should never be used in production.\n\n` + `Unless your site has a complex or custom webpack/Gatsby ` + `configuration this is likely a bug in Gatsby. ` + `Please report this at https://github.com/gatsbyjs/gatsby/issues ` + `with steps to reproduce this error.`);
}


const getPathFromProps = props => props.pageResources && props.pageResources.page ? (0, _normalizePagePath.default)(props.pageResources.page.path) : undefined;


class PageQueryStore extends _react.default.Component {
  constructor(props) {
    super(props);
    this.state = {
      pageData: null,
fork icon0
star icon0
watch icon1

+ 2 other calls in file

148
149
150
151
152
153
154
155
156
157
    renderer( /*#__PURE__*/_react.default.createElement(_loadingIndicator.LoadingIndicatorEventHandler, null), indicatorMountElement);
  }
}

function App() {
  const onClientEntryRanRef = _react.default.useRef(false);

  _react.default.useEffect(() => {
    if (!onClientEntryRanRef.current) {
      onClientEntryRanRef.current = true;
fork icon0
star icon0
watch icon1

29
30
31
32
33
34
35
36
    };
    return (react_1.default.createElement(material_1.Grid, { container: true, className: UserInteraction_module_css_1.default.container, onKeyDown: handleKeyDown },
        react_1.default.createElement(material_1.Box, { className: UserInteraction_module_css_1.default.text },
            react_1.default.createElement(material_1.TextField, { type: "text", variant: "outlined", value: typedContent, onChange: handleTyping, className: UserInteraction_module_css_1.default.input })),
        react_1.default.createElement(material_1.Box, { className: UserInteraction_module_css_1.default.btnctn },
            react_1.default.createElement(material_1.Button, { className: UserInteraction_module_css_1.default.button, onClick: handleSend, endIcon: react_1.default.createElement(Send_1.default, null) }))));
};
exports.default = UserInteraction;
fork icon0
star icon0
watch icon1

+ 3 other calls in file

14
15
16
17
18
19
20
21
22
23
 */
var postFactory = function (message, index) {
    switch (message === null || message === void 0 ? void 0 : message.media) {
        case null:
        case undefined:
            return react_1.default.createElement(TextPost_1.default, { index: index, message: message });
        default:
            return react_1.default.createElement(ImagePost_1.default, { index: index, message: message });
    }
};
fork icon0
star icon0
watch icon1

95
96
97
98
99
100
101
102
103
104
    formData.firstName,
    " ",
    formData.lastName),
react_1.default.createElement("p", { className: "mb-4" }, "Enter password to unlock your account."),
react_1.default.createElement("form", { role: "form" },
    react_1.default.createElement("div", { className: "mb-3" },
        react_1.default.createElement("input", { type: "password", name: "password", className: "form-control", placeholder: "Password", "aria-label": "password", value: formData.password, onChange: handleChange })),
    react_1.default.createElement("div", { className: "mb-3" },
        react_1.default.createElement("input", { type: "password", name: "confirmPassword", className: "form-control", placeholder: "Confirm password", "aria-label": "confirm-password", value: formData.confirmPassword, onChange: handleChange })),
    react_1.default.createElement("div", { className: "text-center" },
fork icon0
star icon0
watch icon1

+ 20 other calls in file

78
79
80
81
82
83
84
85
86
87
react_1.default.createElement("div", { className: "col-md-4 position-relative" },
    react_1.default.createElement("div", { className: "p-3 text-center" },
        react_1.default.createElement("h1", { className: "text-gradient text-primary" },
            react_1.default.createElement("span", { id: "state2" }, "100"),
            "+"),
        react_1.default.createElement("h5", { className: "mt-3" }, "Projects"),
        react_1.default.createElement("p", { className: "text-sm" }, "Test")),
    react_1.default.createElement("hr", { className: "vertical dark" })),
react_1.default.createElement("div", { className: "col-md-4" },
    react_1.default.createElement("div", { className: "p-3 text-center" },
fork icon0
star icon0
watch icon1

+ 44 other calls in file

75
76
77
78
79
80
81
82
83
            }
        }
        return props;
    };
    return (react_1.default.createElement(react_1.default.Fragment, null, isLoggedIn ? (react_1.default.createElement(react_router_dom_1.Switch, null,
        react_1.default.createElement(react_router_dom_1.Route, { exact: true, path: types_1.RoutePath.AUTH_WILDCARD, render: (props) => renderer(Authenticate_1.default, props) }),
        react_1.default.createElement(react_router_dom_1.Route, { exact: true, path: types_1.RoutePath.INVITE_WILDCARD, render: (props) => renderer(Authenticate_1.default, props) }))) : (react_1.default.createElement(react_router_dom_1.Switch, null,
        react_1.default.createElement(react_router_dom_1.Route, { exact: true, path: types_1.RoutePath.UNAUTHORIZED_WILDCARD, render: (props) => renderer(Authenticate_1.default, props) })))));
});
fork icon0
star icon0
watch icon1

+ 3 other calls in file

79
80
81
82
83
84
85
86
        });
    }, []);
    return (react_1.default.createElement("div", { className: "container-fluid py-4" },
        react_1.default.createElement("div", { className: "row gx-4 mt-4" },
            react_1.default.createElement("div", { className: "col-md-6" },
                react_1.default.createElement(EditCompany_1.default, { companyId: Number(companyId), info: info, setInfo: setInfo, choicesRef: choicesRef }))),
        react_1.default.createElement(InterestBuilder_1.default, { companyId: Number(companyId) })));
});
fork icon0
star icon0
watch icon1

+ 3 other calls in file

57
58
59
60
61
62
63
64
65
66
react_1.default.createElement("div", { className: "container" },
    react_1.default.createElement("div", { className: "row mt-lg-n10 mt-md-n11 mt-n10 justify-content-center" },
        react_1.default.createElement("div", { className: "col-xl-4 col-lg-5 col-md-7 mx-auto" },
            react_1.default.createElement("div", { className: "card z-index-0" },
                react_1.default.createElement("div", { className: "card-header text-center pt-4" },
                    react_1.default.createElement("h5", null, "Sign in")),
                react_1.default.createElement("div", { className: "card-body" },
                    react_1.default.createElement("form", { role: "form", className: "text-start" },
                        react_1.default.createElement("div", { className: "mb-3" },
                            react_1.default.createElement("input", { type: "email", name: "email", value: formData.email, onChange: handleChange, className: "form-control", placeholder: "Email", "aria-label": "Email" })),
fork icon0
star icon0
watch icon1

+ 27 other calls in file

60
61
62
63
64
65
66
67
68
69
70
    baseuri: `/`,
    basepath: `/`
  }
}, /*#__PURE__*/_react.default.createElement(_queryResultStore.PageQueryStore, props));


class LocationHandler extends _react.default.Component {
  render() {
    const {
      location
    } = this.props;
fork icon0
star icon0
watch icon1