[React] react-timezone-select
react-timezone-select
import React, { useState } from 'react';
import styled from 'styled-components';
import TimezoneSelect from 'react-timezone-select';
function Timezone() {
const [timezone, setTimezone] = useState(
Intl.DateTimeFormat().resolvedOptions().timeZone
);
return (
<Section>
<Subtitle>Timezone</Subtitle>
<TimezoneSelect
value={timezone}
onChange={setTimezone}
styles={customStyles}
/>
</Section>
);
}
//styled-components부분의 코드는 생략
コードはとても簡単です.
npmサイト(クリック)
また、基本的には、スタイルの方法は広く使われているreact-selectと同じです.react-selectライブラリの使用方法も後で説明します.
Reference
この問題について([React] react-timezone-select), 我々は、より多くの情報をここで見つけました https://velog.io/@sodalite1204/React-react-timezone-selectテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol