Merge pull request #5262 from matrix-org/t3chguy/fix/15286
MELS use latest avatar rather than the first avatar
This commit is contained in:
commit
6caf53bd1e
3 changed files with 150 additions and 110 deletions
|
@ -14,11 +14,11 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import {useState} from "react";
|
||||
import {Dispatch, SetStateAction, useState} from "react";
|
||||
|
||||
// Hook to simplify toggling of a boolean state value
|
||||
// Returns value, method to toggle boolean value and method to set the boolean value
|
||||
export const useStateToggle = (initialValue: boolean) => {
|
||||
export const useStateToggle = (initialValue: boolean): [boolean, () => void, Dispatch<SetStateAction<boolean>>] => {
|
||||
const [value, setValue] = useState(initialValue);
|
||||
const toggleValue = () => {
|
||||
setValue(!value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue