Search
lynx.__globalProps is a global variable, which is an object and you can access it from anywhere。
lynx.__globalProps
// The properties within the `lynx.__globalProps` object are not managed by Lynx itself. // Therefore, you must extend its interface yourself. declare module '@lynx-js/types' { interface GlobalProps { appTheme: string; title: string; } } function App() { const themeClass = useMemo( () => `theme-${lynx.__globalProps.appTheme}`, [lynx.__globalProps.appTheme], ); return ( <view class={themeClass}> <text>{lynx.__globalProps.title}</text> </view> ); }
__globalProps can be updated through the API provided by LynxView
__globalProps
LynxView
void updateGlobalProps(@NonNull Map<String, Object> props) void updateGlobalProps(@NonNull TemplateData props)
- (void)updateGlobalPropsWithDictionary:(NSDictionary<NSString*, id>*)data - (void)updateGlobalPropsWithTemplateData:(LynxTemplateData*)data
LCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.