Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React, { useEffect, useState } from 'react'
import { WrapperBox, ApiClient, Placeholder, withNotice, StyledButton} from 'admin-bro'
const api = new ApiClient()
const NOTICE_MESSAGE = {
message: 'I was clicked',
type: 'success',
}
const SomeStats = ({ addNotice }) => {
const [text, setText] = useState('')
useEffect(() => {
api.getPage({ pageName: 'customPage' }).then(res => {
setText(res.data.text)
})
})
return (
componentDidMount() {
const api = new ApiClient()
api.getDashboard({test: 1}).then((response) => {
this.setState({ data: response.data })
})
}