See how we built “PageChat”, a Chrome extension allowing users to access ChatGPT and ask questions about and summarize web pages.
Jetpack Compose is a fairly new UI toolkit for Android that is declarative and represents a departure from the legacy view-based imperative library. It's an adaptation of UI development concepts first made popular by the web UI library React. If you are already familiar with React, you will have an easier time learning Compose. However, in this article, I don't assume the reader has prior knowledge of any declarative UI frameworks.
Prior to the introduction of hooks, if you want to know the previous value of a React component’s prop or state, you’d have to implement the life cycle method componentDidUpdate(prevProps, prevState){...}. However, with hooks, you can’t use class components and life-cycle methods and there is no built-in mechanism of accessing the previous value of a prop or state from your function components. Fortunately, you can write a custom hook that relies on useRef and useEffect to remember previous values of any value it’s provided.