[React] Close the menu component when click outside the menu

Most of the time, your components respond to events that occur within the component tree by defining their own handler or by accepting a handler defin
393次阅读

[React] Style the body element with styled-components and "injectGlobal"

In this lesson, we see how we can apply styles globally with the "injectGlobal" helper method in styled-components. This method allows us to apply sty
47次阅读

[React] Style a React component with styled-components

In this lesson, we remove the mapping between a React component and the styles applied to it via classnames. We write our styles directly within the c
59次阅读

[React Intl] Use a react-intl Higher Order Component to format messages

In some cases, you might need to pass a string from your intl messages.js file as a prop to a component. Instead of using react-intl&nb
56次阅读

[React Intl] Render Content Based on a Number using react-intl FormattedMessage (plural)

Using the react-intl FormattedMessage component, we’ll learn how to render content conditionally in our messages based on a numbe
44次阅读

[React Intl] Format Numbers with Separators and Currency Symbols using react-intl FormattedNumber

Using a react-intl FormattedNumber component, we'll pass a Number and a few additional props in order to render the correct separator a
54次阅读

[React Intl] Format a Date Relative to the Current Date Using react-intl FormattedRelative

Given a date, we’ll use the react-intl FormattedRelative component to render a date in a human readable format, such as “2
58次阅读

[React Intl] Format Date and Time Using react-intl FormattedDate and FormattedTime

Using the react-intl FormattedDate and FormattedTime components, we’ll render a JavaScript Date into both a date string
65次阅读

[React Intl] Render Content with Markup Using react-intl FormattedHTMLMessage

In this lesson, we’ll use the react-intl FormattedHTMLMessage component to display text with dynamic values along with other HTML
79次阅读

[React Intl] Render Content with Placeholders using react-intl FormattedMessage

Learn how to use react-intl to set dynamic values into your language messages. We’ll also learn how to pass in those values by using a
51次阅读