Hello community,
I am now taking Monday.com API certificate course and very new in code writing.
I have built a board view app with the sentence “Hello, monday apps!”. I need then to set an event listener using the monday.listen method so when a background color is changed, the selected color will actually apear in that board view. Unfortunatelly I get an error massages like “unexpected token” or “Missing Semicolon”.
Here is the code, your help will be appreciated. Thank you
import React from “react”;
import { useState, useEffect } from “react”;
import “./App.css”;
import mondaySdk from “monday-sdk-js”;
import “monday-ui-react-core/dist/main.css”;
//Explore more Monday React Components here: https://style.monday.com/
import AttentionBox from “monday-ui-react-core/dist/AttentionBox.js”;
// Usage of mondaySDK example, for more information visit here: Software development kit (SDK)
const monday = mondaySdk();
const App = () => {
const [context, setContext] = useState();
useEffect(() => {
// Notice this method notifies the monday platform that user gains a first value in an app.
// Read more about it here: monday.execute
monday.execute(“valueCreatedForUser”);
// TODO: set up event listeners, Here`s an example, read more here: https://developer.monday.com/apps/docs/mondaylisten/
componentDidMount() {
monday.listen(“settings”, res => {
this.setState({ settings: res.data });
});
}
//Some example what you can do with context, read more here: monday.get
const attentionBoxText = Hello, your user_id is: ${ context ? context.user.id : "still loading" }. Let's start building your amazing app, which will change the world!
;
return (
export default App;