This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun <T> RetainStateCrossfade( | |
targetState: T, | |
modifier: Modifier = Modifier, | |
animationSpec: FiniteAnimationSpec<Float> = tween(), | |
content: @Composable (T) -> Unit | |
) { | |
val items = remember { mutableStateListOf<RetainStateCrossfadeAnimationItem<T>>() } | |
val transitionState = remember { MutableTransitionState(targetState) } | |
val targetChanged = (targetState != transitionState.targetState) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useState} from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
const App = () => { | |
const [items, setItems] = useState([]); | |
const [text, setText] = useState(''); | |
const handleChange = (e) => { | |
setText(e.target.value); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
function App() { | |
return ( | |
<div className="App"> | |
<header className="App-header"> | |
<img src={logo} className="App-logo" alt="logo" /> | |
<p> |