Skip to content

Render without any style,And there is a warning #217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
danceli opened this issue Apr 4, 2023 · 6 comments
Open

Render without any style,And there is a warning #217

danceli opened this issue Apr 4, 2023 · 6 comments

Comments

@danceli
Copy link

danceli commented Apr 4, 2023

environment:
"react": "^17.0.2",
"react-dom": "^17.0.2",

"@stoplight/json-schema-viewer": "4.5.0",
"@stoplight/markdown-viewer": "^5",
"@stoplight/mosaic": "^1.24.4",
"@stoplight/mosaic-code-viewer": "^1.24.4",

warning
[DEPRECATED]: use useSetAtom from jotai instead.

@bulentozdil
Copy link

I'm currently getting this warning and does not render properly.
environment:

 "dependencies": {
    "@stoplight/json-schema-viewer": "^4.9.0",
    "eslint": "8.40.0",
    "eslint-config-next": "13.4.1",
    "next": "13.4.1",
    "react": "18.2.0",
    "react-dom": "18.2.0"
  }

Screenshot 2023-05-11 at 14 45 04

@GwenythIO
Copy link

@bulentozdil I had a similar problem and was able to add styles by following this example:

injectStyles();
return (
<MosaicProvider>
<Box mx="auto" py={20} px={8} style={{ maxWidth: 800 }}>
<Story />
</Box>
</MosaicProvider>
);
};

I am also running into the error:

warning
[DEPRECATED]: use useSetAtom from jotai instead.

@robbieaverill
Copy link

Hi Spotlight team, the theming (or even just getting default styles to display) aspect of using this module seems a little tricky and undocumented - some insight would be great. I realise that Mosaic appears to be a deliberately unlicensed design system. Are there other solutions, e.g. customisation of components within the viewer?

@robbieaverill
Copy link

For reference, I've also raised the Jotai deprecation issue separately: #259

@johnboy-leeds
Copy link

@bulentozdil I had a similar problem and was able to add styles by following this example:

json-schema-viewer/.storybook/preview.jsx

Lines 20 to 29 in e620432

injectStyles();

return (

<Box mx="auto" py={20} px={8} style={{ maxWidth: 800 }}>



);
};
I am also running into the error:

warning
[DEPRECATED]: use useSetAtom from jotai instead.

Thank you for this example, I was hitting a brick wall trying to figure out how to get the styling in.

@NINGyv179
Copy link

NINGyv179 commented May 13, 2025

@bulentozdil I had a similar problem and was able to add styles by following this example:
json-schema-viewer/.storybook/preview.jsx
Lines 20 to 29 in e620432
injectStyles();
return (

<Box mx="auto" py={20} px={8} style={{ maxWidth: 800 }}>

);
};
I am also running into the error:

warning
[DEPRECATED]: use useSetAtom from jotai instead.

Thank you for this example, I was hitting a brick wall trying to figure out how to get the styling in.

Can you use this component now? I have also encountered the same style problem. Could you please tell me what to do?

---oh,I successfully rendered it after using import {injectStyles} from '@stoplight/mosaic' injectStyles()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants