mintsweet commented on code in PR #2928:
URL: https://github.com/apache/incubator-devlake/pull/2928#discussion_r963199391
##########
config-ui/src/hooks/useConnectionManager.jsx:
##########
@@ -42,15 +43,13 @@ function useConnectionManager (
const [provider, setProvider] = useState(activeProvider)
const [name, setName] = useState()
+ // @todo: refactor to endpoint and setEndpoint
const [endpointUrl, setEndpointUrl] = useState()
const [proxy, setProxy] = useState()
- const [rateLimit, setRateLimit] = useState(0)
+ const [rateLimitPerHour, setRateLimitPerHour] = useState(0)
const [token, setToken] = useState()
- const [initialTokenStore, setInitialTokenStore] = useState({
- 0: '',
- 1: '',
- 2: ''
- })
+ const defaultTokenStore = useMemo(() => ({ 0: '', 1: '', 2: '' }), [])
Review Comment:
I think the defaultTokenStore should be placed outside the component so that
it will only be declared when the app is initialized.useMemo brings performance
issues.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]