Download wp-calypso/client/components/data/query-jitm/index.jsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 700 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/data/query-jitm/index.jsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/components/data/query-jitm/index.jsx
-
curl -L -o index.jsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/data/query-jitm/index.jsx
700 Bytes
| import PropTypes from 'prop-types'; | |
| import { useEffect } from 'react'; | |
| import { useDispatch, useSelector } from 'react-redux'; | |
| import { getCurrentUserLocale } from 'calypso/state/current-user/selectors'; | |
| import { fetchJITM } from 'calypso/state/jitm/actions'; | |
| export default function QueryJITM( { siteId, messagePath, searchQuery } ) { | |
| const locale = useSelector( getCurrentUserLocale ); | |
| const dispatch = useDispatch(); | |
| useEffect( () => { | |
| dispatch( fetchJITM( siteId, messagePath, searchQuery, locale ) ); | |
| }, [ dispatch, siteId, messagePath, searchQuery, locale ] ); | |
| return null; | |
| } | |
| QueryJITM.propTypes = { | |
| siteId: PropTypes.number.isRequired, | |
| messagePath: PropTypes.string.isRequired, | |
| }; | |