Technically the check for iOS from components is a side effect, because it's neither in state nor props, but the user agent does not change, so I think that's okay.
		
			
				
	
	
		
			12 lines
		
	
	
		
			230 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
		
			230 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
const LAYOUT_BREAKPOINT = 1024;
 | 
						|
 | 
						|
export function isMobile(width) {
 | 
						|
  return width <= LAYOUT_BREAKPOINT;
 | 
						|
};
 | 
						|
 | 
						|
const iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
 | 
						|
 | 
						|
export function isIOS() {
 | 
						|
  return iOS;
 | 
						|
};
 |