question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add imports to docs examples

See original GitHub issue

Currently docs feature examples like this:

const MyComponent = () => (
  <Button raised onPress={() => console.log('Pressed')}>
    Press me
  </Button>
);

What I find not great for DX here is the lack of import statement, which clearly states how to import the module.

This looks much better and removes the ambiguity of how to import specific component:

import { Button } from 'react-native-paper';

const MyComponent = () => (
  <Button raised onPress={() => console.log('Pressed')}>
    Press me
  </Button>
);

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
thymikeecommented, Feb 27, 2018

Do it 😃

1reaction
satya164commented, Feb 27, 2018

If we are adding imports, let’s add everything that’s needed to copy/paste and run the example

Read more comments on GitHub >

github_iconTop Results From Across the Web

Import data sets & spreadsheets - Google Docs Editors Help
On your computer, open a spreadsheet in Google Sheets. Open or create a sheet. At the top, click File and then Import. Choose...
Read more >
Importing Your Documentation - Read the Docs
To import a public documentation repository, visit your Read the Docs dashboard and click Import. For private repositories, please use Read the Docs...
Read more >
Utility API docs: Add @import functions, variables to ... - GitHub
Utility API docs: Add @import functions, variables to the examples. Since _utilities references, _variables , and _variables references ...
Read more >
5. The import system — Python 3.11.1 documentation
The first is the fully qualified name of the module being imported, for example foo.bar.baz . The second argument is the path entries...
Read more >
import - JavaScript - MDN Web Docs - Mozilla
In HTML, this is done by adding type="module" to the <script> tag. ... For example, if the module imported above includes an export ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found