Skip to content
This repository was archived by the owner on Mar 11, 2021. It is now read-only.

Commit 269e7d6

Browse files
bc022699bc022699
authored andcommitted
Fix material context access
1 parent c5d35ad commit 269e7d6

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "framework7-react",
3-
"version": "0.8.2-beta-3",
3+
"version": "0.8.2-beta-4",
44
"description": "A React version of Framework7",
55
"main": "dist/framework7-react/index.js",
66
"typings": "dist/framework7-react/index.d.ts",

src/components/Framework7App.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ export class Framework7App extends React.Component<IFramework7AppProps, Framewor
8888
}
8989

9090
private initFramework7() {
91-
this.framework7 = new Framework7(this.props);
91+
this.framework7 = new Framework7({
92+
material: this.props.themeType === 'material',
93+
...this.props
94+
});
9295

9396
const router = this.router = new Framework7Router(this.props.routes, this.framework7, Dom7);
9497

src/utils/ReactifyF7Vue.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,12 @@ export const reactifyF7Vue = <TProps>(args: IReactifyF7VueArgs) => {
7575

7676
render: function() {
7777
const props = this.props;
78-
78+
const framework7AppContext = (this.context as any).framework7AppContext as IFramework7AppContext;
79+
7980
const innerEl = React.createElement(innerComponent, {
8081
...props,
81-
$theme: { material: false, ios: true },
82+
$theme: framework7AppContext.theme,
8283
__onMount: (self) => {
83-
const framework7AppContext = (this.context as any).framework7AppContext as IFramework7AppContext;
84-
8584
framework7AppContext.getFramework7(f7 => {
8685
if (self.vueComponent.onF7Init) {
8786
self.vueComponent.onF7Init(f7);

0 commit comments

Comments
 (0)