Skip to main content
Rlgo

Remove text offset in List.Accordion of react native paper

When using List.Accordion in react native paper, the children of it will have text offset/space on the left.

Wrapping the children with fragment can avoid this issue because fragments don't inherit the styling props from their parent components.

<List.Accordion>
	{/* Have space offset on left */}
	<Button>Reset</Button>
	<>
		{/* No space offset on left */}
		<Button>Reset</Button>
	</>
</List.Accordion>

Reference #

https://stackoverflow.com/a/71400227