Skip to content

Commit

Permalink
fix(View): add name prop to View for Bara
Browse files Browse the repository at this point in the history
  • Loading branch information
nampdn committed Apr 15, 2019
1 parent fa0b5c3 commit 097d0c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/examples/components/WelcomeText.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { useBarnState, Text, Touchable, View } from '../../lib'
import { Text, Touchable, useBarnState, View } from '../../lib'

export const WelcomeText = () => {
const [message, setMessage] = useBarnState('welcome', 'Welcome to Bara App!')
Expand All @@ -9,7 +9,7 @@ export const WelcomeText = () => {
}

return (
<View>
<View name="message-view">
<Touchable name="change-welcome-message" onPress={changeMessage}>
<Text>{message}</Text>
</Touchable>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/exports/View/View.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface ViewProps extends ViewPropsOriginal, BaraBaseComponentProps {
}

export const View = React.forwardRef(
({ onLayout: _onLayout, ...props }: ViewProps, ref: any) => {
({ onLayout: _onLayout, name, ...props }: ViewProps, ref: any) => {
const context = useBaraContext()
const onLayout: typeof _onLayout = e => {
context.components.view.onLayout({ name, ...props })
Expand Down

0 comments on commit 097d0c1

Please sign in to comment.