react-moment icon indicating copy to clipboard operation
react-moment copied to clipboard

Style React-Native element

Open Gerharddc opened this issue 7 years ago • 2 comments

I see that I am supposed to provide a class type like 'Text' to the element prop in React-Native. This works but I cannot figure out how to style that element because I am can just pass the class as a type and Moment does not have a 'style' prop for forwarding. How should I do this?

Gerharddc avatar Jan 17 '18 21:01 Gerharddc

+1 on this issue

nicovanzyl avatar Mar 26 '18 08:03 nicovanzyl

Yes it is possible to add a styling prop to the Moment component. Check it out!

<Moment style={this.props.style} tz={DeviceInfo.getTimezone()} element={Text} format="MMMM Do hh:mmA">
            {this.props.date}
      </Moment>

ajboxjr avatar May 26 '18 07:05 ajboxjr