We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plan
The text was updated successfully, but these errors were encountered:
@vadim9999 Can you add few options, related to connecting showcase with fake-api?
And I also think that we need to introduce our developer to https://github.com/GroceriStar/antd-showcase-components - it's a place where we keeping simple components, related to showcase projects. this is a empty react project, where i'm testing components and fixing small errors: https://github.com/GroceriStar/antd-showcase-sandbox
Sorry, something went wrong.
selector.js in showcase has url of database fake-api
const URL = 'https://grocerylists-fake-api.herokuapp.com';
function getResponse(route) has attribute route that must be route after url.
async function getResponse(route) { let response; try { response = await axios.get(URL + route); console.log("Respons"); console.log(response); } catch (error) { console.error(error); } return response; }
If you want to write new method you can use function getResponse(). For exaple
function getFullGrocery( name ) { return getResponse("/grocery/name/" + name) }
after that in component where you want to get data you should do like this
constructor(props){ super(props) this.state = { data: [] } } async componentDidMount(){ try { let response = await getFullGrocery(this.props.name); this.setState({ data: response.data }) } catch (e) { console.error("Can't connect to Database"); } }
No branches or pull requests
Plan
The text was updated successfully, but these errors were encountered: